Ok, maybe i didnt explain that well...
Irregardless of what im using, im encrypting a string so.. "Phil" +
"password(s)" becomes "#sakdhk3hk34s2"; (not real i just typed
gibbrish); and then can be reversed.
forget the database for now, -- If i run my encryption function on
the contents of a ASCII file (using fopen) i can encrypt and decrypt
it fine, so i tried with my fingers crossed to see if it would work on
a binary file -- it didn't.
So, Pretending im starting from scratch, how would i encrypt a binary
file? and then be able to decrypt it using a 'password'.
So FILE + "password" = 'garbage'
and garbage + "password" = FILE
--
If i cant nativly do it in PHP, is there Server based software i can
install and just run cron system commands?
Thanks,
PHil
Michael Fesser <ne*****@gmx.net> wrote in message news:<1j********************************@4ax.com>. ..
.oO(Phil Palmieri)
Im using md5 to encrypt and decrypt plain text, this works fine...
Huh?
When i try to run the same function on a binary file, it does not
decrypt correctly. Is there a way to encrypt binary files correctly,
and be able to decrypt them?
MD5 is a hash algorithm, which is not reversible by definition. In other
words: You can't decrypt a hash.
in the perfect situation i would like to be able to store the
encrypted binary file into a mysql blob field, or at least be able to
save an encrypted version of the binary file on the server.
In most cases it's better to store binary data in real files. Storing it
as BLOBs in a database will probably slow down the db server and make
queries inefficient.
Anyway, you might want to have a look at Mcrypt.
http://www.php.net/mcrypt
PHP's Encryption Functionality [page 3]
http://www.onlamp.com/pub/a/php/2001...pt.html?page=3
Micha