#1 2010-09-25 16:43:33

arthurprs
Member
Registered: 2010-09-25
Posts: 3

IV and AES in SynCrypto (MyCrypto)

Hi, how can i set the IV before encrypting AES?

Thanks in advance.
Arthur.

Last edited by arthurprs (2010-09-25 17:18:23)

Offline

#2 2010-09-25 16:50:52

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,242
Website

Re: IV and AES in SynCrypto (MyCrypto)

See TAES.EncryptInit and TAES.DecryptInit and implement your own version, before calling TAES.Encrypt and TAES.Decrypt

Offline

#3 2010-09-25 17:06:58

arthurprs
Member
Registered: 2010-09-25
Posts: 3

Re: IV and AES in SynCrypto (MyCrypto)

Thanks for the quick reply.

If i just fill the .IV array with the value it will work?

I searched for ".IV" on the unit but I found no references (except padlock specific ones).

Arthur.

Edit: Sorry, there was a mistake in my first post, i need to set it before encrypting, not decrypting.

Last edited by arthurprs (2010-09-25 17:19:26)

Offline

#4 2010-09-25 17:34:58

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,242
Website

Re: IV and AES in SynCrypto (MyCrypto)

We provide only ECB mode of encryption.
So IV is not to be set here.

If you implement other modes (CBC or even better CTR, if you want it to be easily parallelized with multiple CPUs), you'll have to use the IV.

Offline

#5 2010-09-25 17:46:23

arthurprs
Member
Registered: 2010-09-25
Posts: 3

Re: IV and AES in SynCrypto (MyCrypto)

Well, I don't know much about encryption (I just googled about ecb and cbc).

So I guess there is no easy way to modify the library to fit my need, is that right?

Thanks for your time, have a great weekend.

Offline

#6 2010-09-25 18:29:43

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,242
Website

Re: IV and AES in SynCrypto (MyCrypto)

Which mode do you need?

Offline

#7 2010-10-05 19:11:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,242
Website

Re: IV and AES in SynCrypto (MyCrypto)

Offline

#8 2012-01-26 15:53:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,242
Website

Re: IV and AES in SynCrypto (MyCrypto)

I've added TAESCBC, TAESCFB, TAESOFB and TAESCTR classes to handle AES encryption of memory buffers in CBC, CFB, OFB and CTR mode (including PKCS7 padding) in SynCrypto.pas.

This will cover most useful patterns of the AES algorithm.

See http://synopse.info/fossil/info/8482ce8dda and http://synopse.info/fossil/info/215558e943

Offline

Board footer

Powered by FluxBB