Main Page | Report this Page
 
   
Science Forum Index  »  Cryptography Forum  »  Cipher Length with Rijndael
Page 1 of 1    
Author Message
Jeff Kanel
Posted: Wed Dec 31, 2003 12:58 pm
Guest
I'm using Rijndael with a 256-bit key and 128-bit block size.

Can anyone tell me how many bytes I'll need to store in my database
per byte of input?

In other words...if my plain-text is 32 bytes, how many bytes long is
the cipher-text.

I'm sure it's not linear, so can anyone point me to a formula?

Thanks!
Jeff Kanel
Jean-Luc Cooke
Posted: Wed Dec 31, 2003 1:11 pm
Guest
Jeff, I'll assume you're using CTR or CBC mode.

encLength = 16*((inputLength + 15) /16);

values are in bytes

JLC

Jeff Kanel <jkanel_ng@yahoo.com> wrote:
Quote:
I'm using Rijndael with a 256-bit key and 128-bit block size.

Can anyone tell me how many bytes I'll need to store in my database
per byte of input?

In other words...if my plain-text is 32 bytes, how many bytes long is
the cipher-text.

I'm sure it's not linear, so can anyone point me to a formula?

Thanks!
Jeff Kanel

--
Jean-Luc Cooke
Posted: Wed Dec 31, 2003 1:11 pm
Guest
Jeff, I'll assume you're using CTR or CBC mode.

encLength = 16*((inputLength + 15) /16);

values are in bytes

JLC

Jeff Kanel <jkanel_ng@yahoo.com> wrote:
Quote:
I'm using Rijndael with a 256-bit key and 128-bit block size.

Can anyone tell me how many bytes I'll need to store in my database
per byte of input?

In other words...if my plain-text is 32 bytes, how many bytes long is
the cipher-text.

I'm sure it's not linear, so can anyone point me to a formula?

Thanks!
Jeff Kanel

--
Tom St Denis
Posted: Wed Dec 31, 2003 1:17 pm
Guest
"Jeff Kanel" <jkanel_ng@yahoo.com> wrote in message
news:8d62ab6.0312310958.131f6275@posting.google.com...
Quote:
I'm using Rijndael with a 256-bit key and 128-bit block size.

Can anyone tell me how many bytes I'll need to store in my database
per byte of input?

In other words...if my plain-text is 32 bytes, how many bytes long is
the cipher-text.

I'm sure it's not linear, so can anyone point me to a formula?

I don't quite get the question. Rijndael is a bijection which means it
doesn't expand the input at all. 16 bytes in, 16 bytes out.

So for s 32 byte message you'll have 32 bytes of ciphertext. [Even if you
use a mode like CTR you can work that into the scheme so for a group of
messages you need only one IV and you can calc the IV for each message from
the master IV....]

Tom
Tom St Denis
Posted: Wed Dec 31, 2003 1:17 pm
Guest
"Jeff Kanel" <jkanel_ng@yahoo.com> wrote in message
news:8d62ab6.0312310958.131f6275@posting.google.com...
Quote:
I'm using Rijndael with a 256-bit key and 128-bit block size.

Can anyone tell me how many bytes I'll need to store in my database
per byte of input?

In other words...if my plain-text is 32 bytes, how many bytes long is
the cipher-text.

I'm sure it's not linear, so can anyone point me to a formula?

I don't quite get the question. Rijndael is a bijection which means it
doesn't expand the input at all. 16 bytes in, 16 bytes out.

So for s 32 byte message you'll have 32 bytes of ciphertext. [Even if you
use a mode like CTR you can work that into the scheme so for a group of
messages you need only one IV and you can calc the IV for each message from
the master IV....]

Tom
David A. Scott
Posted: Wed Dec 31, 2003 3:40 pm
Guest
jkanel_ng@yahoo.com (Jeff Kanel) wrote in
news:8d62ab6.0312310958.131f6275@posting.google.com:

Quote:
I'm using Rijndael with a 256-bit key and 128-bit block size.

Can anyone tell me how many bytes I'll need to store in my database
per byte of input?

In other words...if my plain-text is 32 bytes, how many bytes long is
the cipher-text.

I'm sure it's not linear, so can anyone point me to a formula?

Thanks!
Jeff Kanel



If your using plain AES CBC with plain padding you always need at most
2 + lenght/16
example 1 to 15 btyes 2 blocks at a length of 16 to 31 you need 3
and so on.

For you example of 32 bytes you would need 4 blocks. However if the
IV block is like a part of key and you don't need to sent it you could
subtract one making it 3 blocks. And if your data is always a multiple
of 16 you really don't need padding in which case you could subtract
another one leavein it 2.




David A. Scott
--
My Crypto code
http://cryptography.org/cgi-bin/crypto.cgi/Misc/scott19u.zip
http://cryptography.org/cgi-bin/crypto.cgi/Misc/scott16u.zip
http://www.jim.com/jamesd/Kong/scott19u.zip old version
My Compression code http://bijective.dogma.net/
**TO EMAIL ME drop the roman "five" **
Disclaimer:I am in no way responsible for any of the statements
made in the above text. For all I know I might be drugged.
As a famous person once said "any cryptograhic
system is only as strong as its weakest link"
David A. Scott
Posted: Wed Dec 31, 2003 3:40 pm
Guest
jkanel_ng@yahoo.com (Jeff Kanel) wrote in
news:8d62ab6.0312310958.131f6275@posting.google.com:

Quote:
I'm using Rijndael with a 256-bit key and 128-bit block size.

Can anyone tell me how many bytes I'll need to store in my database
per byte of input?

In other words...if my plain-text is 32 bytes, how many bytes long is
the cipher-text.

I'm sure it's not linear, so can anyone point me to a formula?

Thanks!
Jeff Kanel



If your using plain AES CBC with plain padding you always need at most
2 + lenght/16
example 1 to 15 btyes 2 blocks at a length of 16 to 31 you need 3
and so on.

For you example of 32 bytes you would need 4 blocks. However if the
IV block is like a part of key and you don't need to sent it you could
subtract one making it 3 blocks. And if your data is always a multiple
of 16 you really don't need padding in which case you could subtract
another one leavein it 2.




David A. Scott
--
My Crypto code
http://cryptography.org/cgi-bin/crypto.cgi/Misc/scott19u.zip
http://cryptography.org/cgi-bin/crypto.cgi/Misc/scott16u.zip
http://www.jim.com/jamesd/Kong/scott19u.zip old version
My Compression code http://bijective.dogma.net/
**TO EMAIL ME drop the roman "five" **
Disclaimer:I am in no way responsible for any of the statements
made in the above text. For all I know I might be drugged.
As a famous person once said "any cryptograhic
system is only as strong as its weakest link"
Paul Crowley
Posted: Thu Jan 01, 2004 2:26 pm
Guest
jkanel_ng@yahoo.com (Jeff Kanel) writes:

Quote:
I'm using Rijndael with a 256-bit key and 128-bit block size.

Can anyone tell me how many bytes I'll need to store in my database
per byte of input?

That depends on your mode of operation, how many items you'll be
storing, and your security requirements.

EAX or CWC mode with an 8-byte nonce and 8-byte tag will expand your
plaintext by 16 bytes.

http://www.cs.berkeley.edu/~daw/papers/eax.html
http://www.zork.org/cwc/
http://fp.gladman.plus.com/AES/

It's unfortunate that you're having to implement the crypto yourself -
these things are nearly impossible for the crypto newcomer to make
secure - but I don't see an alternative for you.
--
__ Paul Crowley
\/ o\ sig@paul.ciphergoth.org
/\__/ http://www.ciphergoth.org/
Paul Crowley
Posted: Thu Jan 01, 2004 2:26 pm
Guest
jkanel_ng@yahoo.com (Jeff Kanel) writes:

Quote:
I'm using Rijndael with a 256-bit key and 128-bit block size.

Can anyone tell me how many bytes I'll need to store in my database
per byte of input?

That depends on your mode of operation, how many items you'll be
storing, and your security requirements.

EAX or CWC mode with an 8-byte nonce and 8-byte tag will expand your
plaintext by 16 bytes.

http://www.cs.berkeley.edu/~daw/papers/eax.html
http://www.zork.org/cwc/
http://fp.gladman.plus.com/AES/

It's unfortunate that you're having to implement the crypto yourself -
these things are nearly impossible for the crypto newcomer to make
secure - but I don't see an alternative for you.
--
__ Paul Crowley
\/ o\ sig@paul.ciphergoth.org
/\__/ http://www.ciphergoth.org/
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Sat Sep 06, 2008 3:19 pm