Jump to content
Tuts 4 You

Rijndeal 128, 192 , 256 example


ragdog

Recommended Posts

Posted (edited)

Hello


 


I want a example about Rijndeal 128, 192 , 256 in Asm,Cpp


Now  have i searched many hours but without good results.


 


I found this drizz cryptohash.lib but with differents results as this page


http://www.tools4noobs.com/online_tools/encrypt/


 


Key=Tuts4You


Text=Tuts4You


 


Result in hex


 


256= 18fa02ae57bfc4d9e1414c37d2d5e49898b1c6ce59a2a10fced00a36c6492f64


192= 521b4e49d550cfa20856c254cac7a199a670af2f7aeb8829


128= 37f9ce5d255f5b4fb7c66cefe4331e97


 


Can your send code examples in Asm or Cpp?!?


 


 


Regards,


raggy

Edited by ragdog
Posted

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 97
which is the same as tools4noobs output 37f9ce5d255f5b4fb7c66cefe4331e97

Totally 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 start
Compile, step over RijndaelEncrypt in a debugger and examine contents of "output"
  • Like 1
Posted

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?

Posted

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. :)
Posted

AES version?


 


Gives a AES version for Masm?


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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...