Click here to Skip to main content
15,905,915 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
Hello i want to implement AES algorithm. I have already implemented .net inbuilt algorithm. but it returns result in all aphanumeric. i want only hash value result the result should be in 0-9 A-F.

Please help me. I need it in C#.

Thanks
Posted
Comments
Don Jomar Hombrebueno 1-Jul-11 2:09am    
As far as I know AES is a symmetric cryptography that can encode text to cipher text and decode cipher text to its original form using key (authenticity/privacy). Hashing on the other hand is hashing algorithm that checks the integrity of your data. For my opion you're most likely talking about encoding(base16 0-1 A-F) rather than hash. well it's just my opinion.
Sergey Alexandrovich Kryukov 1-Jul-11 2:11am    
Not a correct question. You say "I want to implement AES algorithm", but as far as you explanation goes, you need already written AES algorithm. This is not the same.
--SA

1 solution

I am not sure what you have done, or are trying to do - as mentioned in the comments, AES is an encryption algorithm, not a hashing algorithm. However, regardless of which you need to use look at the Convert.ToBase64String Method[^] which will change the output to a "readable" string.

You may also need the Convert.FromBase64String Method[^] to reverse the process.
 
Share this answer
 
Comments
shailesh125 1-Jul-11 3:05am    
I want to implement AES algorithm which returns cipher in hash value
for e.g
key = 00000000000000000000000000000000
input = 6a84867cd77e12ad07ea1be895c53fa3
output/ciphertext should be 732281c0a0aab8f7a54a0c67a0c45ecf

but microsoft inbuilt algorithm returns ciphertext like this for same key and input :
igiHepR/GMYh7QCFGEnJBiqx65u0rx9WrBNERTNsN2qvlU2BP+t6bte2P4ApsKwt

the value is in alphanumeric field i want just between 0-9 A-F(hex)
OriginalGriff 1-Jul-11 3:23am    
Then look at the base64 conversion methods: I still think you are confused about what you are doing.
What are you actually trying to do with this information? Why are you using AES with a empty key?
shailesh125 2-Jul-11 1:10am    
This is my clent's requirement he want this type of algorithm
OriginalGriff 2-Jul-11 4:06am    
To do what? Sometimes the client must be educated as well... :laugh:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900