How do u MD 5 Encrypt a string of text with VB?
Printable View
How do u MD 5 Encrypt a string of text with VB?
xor the output from MD5 with the string....
use the attached file. and btw, MD5 is not an encryption routine, it is a hash, which means that there is no way to go back.
Unless you Xor it.... then you can go back to your original string....Quote:
Originally posted by BuggyProgrammer
use the attached file. and btw, MD5 is not an encryption routine, it is a hash, which means that there is no way to go back.
I made an encryption algorithm with MD5 and SHA, so i know what i'm talking about... and probably wpearsall intends to do the same thing...
example:
Encoding:
HASH - XOR - your_string = unreadable_string
Decoding:
unreadable_string - XOR - HASH = your_string
What is the difference between this and string xor 10, etc? Its still crap encryption, that coul be broken without much effort(frequency counts).Quote:
Originally posted by CVMichael
Unless you Xor it.... then you can go back to your original string....
I made an encryption algorithm with MD5 and SHA, so i know what i'm talking about... and probably wpearsall intends to do the same thing...
example:
Encoding:
HASH - XOR - your_string = unreadable_string
Decoding:
unreadable_string - XOR - HASH = your_string
Z.
how can you reverse it? if you have a 650 meg file how are you going to turn a 26 char to 650 megs?
o nevermind.......... but that would almost take the whole point away from hashing it...
Nope,Quote:
Originally posted by CVMichael
and probably wpearsall intends to do the same thing...
Just check 1 MD5 Password with Another, See if they match, and if they do, let the user login :)
BTW. (Sorry if i sound dumb, its 10 past 3 AM here (gonna head sleep jst now)
But,
How do i call the MD5 HASHer?
init_md5_hash i think.
Zaei... use your head please...Quote:
Originally posted by Zaei
What is the difference between this and string xor 10, etc? Its still crap encryption, that coul be broken without much effort(frequency counts).
Z.
With this type of encryption, you can encrypt a ~ 10GByte file without having ANY patterns, it's like having a password as long as the file !!!
MD5 is a 128 bit hashing algorithm, that means 16 bytes of data
The simple algorithm (easyer to break, but still almost imposible):
let's say the password is "my_password", use the password to get the MD5 hash of the password, then XOR each byte from the hash with each byte of the string that you want to encrypt.
When you pass the 16'th byte, go back to 0, and repeat the same proccess with the next 16 bytes from the hash.
The hard algorithm, that is IMPOSSIBLE to break:
First, think of this: why does the password have to be the same for eash 16 byte hash ?
So...
for the first 16 byte make a hash for this password "my_password_1" -> 7fbb6e72bd1d0dc9be340cfe4a7b2391
for the next 16 bytes make a hash for this password "my_password_2" -> 8f1053fa67a3cfdeb64095c776597db4
for the next 16 bytes make a hash for this password "my_password_3" -> 8796013e6d637d5b65f1b684f36a74d5
for the next 16 bytes make a hash for this password "my_password_4" -> 9eb3067b216ed7dec722e599e167d8c9
Get the idea ? for each time you make a password, you will get a complictly diferent 16 byte hash
Like this, you will really have a password that is as long as the file
Then all you have to do is XOR the hash you get from MD5 with the file....
And this encryption is called "Symmetric-Key Encryption", and the "key" is actually the MD5 ouput, the HASH !!
http://developer.netscape.com/docs/m...n/contents.htm
And if you want to play around with some hashing algorithms, then go to:
http://pajhome.org.uk/crypt/md5/
YAHOO is using this algorithm to hash the password when users log in, just go the log-in page for yahoo, and view the code in the html page, and you'll see the javascript for MD5
Gotcha. Huge key =).
Z.