Forum > Beginners

how to convert md5 into a string?

(1/1)

rezzvy:
hi. i'm new in this thing and my english is not that good. so i'm sorry if it is not clear but i'll try my best.
okey so i tried to convert string to md5 by following this page https://wiki.freepascal.org/hash
and it's working but i have another question since i already convert string to md5 i have to convert it back into string but i don't know how. i was looking a refrence of it in internet but i did not found it or i don't understand. so is there any way to do it?
thank you in advance. and i'm sorry if my english is bad

ASerge:

--- Quote from: rezzvy on May 02, 2021, 06:19:44 am ---...but i have another question since i already convert string to md5 i have to convert it back into string but i don't know how

--- End quote ---
Apparently this is a joke. Of course, this is not possible, because MD5 is only a hash, not encryption.

rezzvy:

--- Quote from: ASerge on May 02, 2021, 07:06:00 am ---
--- Quote from: rezzvy on May 02, 2021, 06:19:44 am ---...but i have another question since i already convert string to md5 i have to convert it back into string but i don't know how

--- End quote ---
Apparently this is a joke. Of course, this is not possible, because MD5 is only a hash, not encryption.

--- End quote ---

i am sorry i did know that.. i really do ahahahaha my fault sir, thanks for the explanation

Remy Lebeau:

--- Quote from: rezzvy on May 02, 2021, 06:19:44 am ---since i already convert string to md5 i have to convert it back into string but i don't know how.

--- End quote ---

A hash is only a one-way value.  You cannot decode a hash back into the original data it came from.  All you can do is hash two pieces of data and compare if they have the same hash.


--- Quote from: rezzvy on May 02, 2021, 06:19:44 am ---so is there any way to do it?

--- End quote ---

No.  If you need 2-way encoding and decoding, you need encryption, not hashing.

Nimral:

--- Quote from: rezzvy on May 02, 2021, 06:19:44 am --- since i already convert string to md5 i have to convert it back into string but i don't know how. i was looking a refrence of it in internet but i did not found it or i don't understand. so is there any way to do it?
thank you in advance. and i'm sorry if my english is bad

--- End quote ---

If I guess your intention right, and if you are indeed after encryption and decryption, look into the blowfish library (built in, just "uses Blowfish") and/or what dcpcrypt (available via the Online Package Manager) offer. Both are well documented in the Wiki.

And don't throw the MD5 code away, you will probably come back to it when you continue thinking about how you store a password, come to the conclusion that this is an exceptionally bad idea (if you can decrypt the password, anyone else can too), and finally reach at the point where everyone reaches sooner or later: don't ever store a password, but store a password hash derived from it. Since hashes are mathematically (almost) irreversible, nobody can restore your original password if he somehow got at the hash bytes, e.g. by stealing te password file from your harddrive. This is where hashing algorithms have one of their primary uses.

Armin.

Navigation

[0] Message Index

Go to full version