ragdog Posted February 15, 2014 Posted February 15, 2014 (edited) Hello I want a example about Rijndeal 128, 192 , 256 in Asm,CppNow have i searched many hours but without good results. I found this drizz cryptohash.lib but with differents results as this pagehttp://www.tools4noobs.com/online_tools/encrypt/ Key=Tuts4YouText=Tuts4You Result in hex 256= 18fa02ae57bfc4d9e1414c37d2d5e49898b1c6ce59a2a10fced00a36c6492f64192= 521b4e49d550cfa20856c254cac7a199a670af2f7aeb8829128= 37f9ce5d255f5b4fb7c66cefe4331e97 Can your send code examples in Asm or Cpp?!? Regards,raggy Edited February 15, 2014 by ragdog
kao Posted February 15, 2014 Posted February 15, 2014 You're probably messing up padding. Rijdael operates on 16 byte blocks, you should pad both key and data with zeroes.Or you could be mixing up encryption modes. tools4noobs by default uses CBC, I'm not sure what Drizz's lib uses - I'm guessing ECB.Output from Drizz's lib:37 F9 CE 5D 25 5F 5B 4F B7 C6 6C EF E4 33 1E 97which is the same as tools4noobs output 37f9ce5d255f5b4fb7c66cefe4331e97Totally trivial sample code I used for checking:.486.model flat, stdcalloption casemap:noneinclude windows.incinclude user32.incinclude kernel32.incincludelib user32.libincludelib kernel32.libinclude rijndael.asm.DATA key db "Tuts4You" db 8 dup (0) input db "Tuts4You" db 8 dup (0) output db 16 dup (0AAh).CODEstart: invoke RijndaelInit, offset key, 16 invoke RijndaelEncrypt, offset input, offset outputend startCompile, step over RijndaelEncrypt in a debugger and examine contents of "output" 1
ragdog Posted February 15, 2014 Author Posted February 15, 2014 Thanks Kao for the fast reply key db "Tuts4You" db 8 dup (0) input db "Tuts4You" db 8 dup (0) The input and password must be at least 16 bytes long?
kao Posted February 15, 2014 Posted February 15, 2014 From wikipedia: AES is a variant of Rijndael which has a fixed block size of 128 bits, and a key size of 128, 192, or 256 bits. By contrast, the Rijndael specification per se is specified with block and key sizes that may be any multiple of 32 bits, both with a minimum of 128 and a maximum of 256 bits.Since pretty much everyone uses AES version (including tools4noobs) - password should be exactly 16/24/32 bytes long.
ragdog Posted February 15, 2014 Author Posted February 15, 2014 AES version? Gives a AES version for Masm?
ToMKoL Posted February 16, 2014 Posted February 16, 2014 (edited) aes.zip Edited February 16, 2014 by ToMKoL
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now