Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

When I run MD5 algorithm I am getting an output in numeric and a few lower case letters. Obviously it uses all numeric digits and rarely i saw some lower case alphabet letter. I need to understand what all the lower case values are in the MD5 output....

share|improve this question

2 Answers 2

up vote 11 down vote accepted

MD5 produces an output of 16 bytes, i.e. 16 values between 0 and 255. What you see is probably an hexadecimal representation of those bytes: each byte is encoded as two characters taken among the digits ('0' to '9') and the first lowercase letters ('a' to 'f'). Each character is to be interpreted as having a numerical value between 0 and 15 ('a' is 10, 'b' is 11,... and 'f' is 15). In a pair of characters corresponding to a given byte, the first character has sixteenfold value. E.g., a byte of value 92 is represented as '5c' because 92 is equal to 5*16+12, and 'c' represents 12.

share|improve this answer
    
Thanks a lot Thomas... Do SHA and RSA too generate hexadecimal values? –  Kars Feb 24 '11 at 22:10
2  
@kars Most modern cryptographic algorithms, including SHA and RSA, simply work with big numbers, which can be represented in many ways: base 16 (hexadecimal) like this is common, but so is base 64, or binary, or others. –  nealmcb Feb 25 '11 at 2:33
1  
@Kars: all cryptographic algorithms produce, more or less, sequences of bits. Bits are assembled into bytes (specifically "octets": a group of eight bits). Any sequence of bytes can be encoded in hexadecimal in the way I describe. –  Thomas Pornin Feb 25 '11 at 15:30

without knowing what implementation of the md5 algorithm your code is using, it's very likely that it's hexidecimal as that is somewhat standard output for md5 routines. See RFC 1321.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.