Forum Moderators: coopster

Message Too Old, No Replies

php crypt

         

music_man

10:07 pm on Jan 12, 2006 (gmt 0)

10+ Year Member



Hi

I have been looking around on how to crypt and decrypt a variable.

I have looked up a phpnoise tutorial but I can't get it to go for me on the system I am using.

I would like to be able to encrypt an input and store it on a flat file database on one page. Then I would like to be able to call up the flat file database and decrypt it, on another page.

Do I have to use gnupgp for this?

whoisgregg

9:42 pm on Jan 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know why the warning is being generated or how to resolve it. I know that generating a single $iv is a shortcut compared to how it's supposed to be done (each crypt gets it's own $iv, which is stored alongside with it.) but I can't see how it could "know" that you took that shortcut. :/

Maybe a good read of this page and it's comments [php.net] could help solve it?

Sorry, I really wish I could provide an answer for you.

music_man

9:49 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



So I can't use this shortcut? I generated a $iv and now I call it on the decryption page. It is not random each time.

music_man

4:10 am on Jan 26, 2006 (gmt 0)

10+ Year Member



Lol this is very frustrating as it almost works and yet there is this crucial step.

music_man

4:59 am on Jan 26, 2006 (gmt 0)

10+ Year Member



I think I could possibly generate the $iv in relation to the $email size and store it with the email in subscribers.txt separated by pipe. Then I can say foreach subscriber get their iv and email and match them up and then decrypt with the key.

What do you think?

whoisgregg

2:34 pm on Jan 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry it took so long, been working. :)

I think I could possibly generate the $iv in relation to the $email size and store it with the email in subscribers.txt separated by pipe. Then I can say foreach subscriber get their iv and email and match them up and then decrypt with the key.

That is how it's "supposed" to work. I'm not certain that will eliminate the error, but it would certainly be worth a try.

music_man

8:06 pm on Jan 26, 2006 (gmt 0)

10+ Year Member



Why would it not stop the error? If it is the way it supposed to be done. I don't want to try and code that all out and find out that it isn't going to work.

whoisgregg

11:01 pm on Jan 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm just trying to not get your hopes up, I'm pretty sure it will work. :)

music_man

11:14 pm on Jan 26, 2006 (gmt 0)

10+ Year Member



It's going to be a mission of a code job. I think I will have to do a whole lot of posting on this forum before it works.

music_man

2:04 am on Jan 27, 2006 (gmt 0)

10+ Year Member



I have the data stored in .htacceess do you think it is worth encrypting?

Is there any other security measure that I could implement instead of crypt?

This 39 message thread spans 2 pages: 39