Ok, thanks Giuliano ,
my question is,
1. I want to use AES CBC mode and RSA separately. right now, I can use AES
to encrypt and decrypt short plaint text. Also I can use RSA public key to
encrypt and private key to decrypt short plaint text..
but my problem is, I need encrypt and decrypt a large data or file, like
100K, 1M or 3M. so, I need to devide these data or files into small ones.
like, AES CBC, I do not know what block size I need to choose? under key
size 128, block size is 128 too? under key size 256, block size 256?
2. for the RSA algorithm, if I choose the key size as different size, like
512, 1024,2048, so, should I change the plaintext different length? it
seems, 512 key size can only encrypt limited size of plain text, and so on.
my problem is, my data or file is huge, do I need to divide the data or file
into small ones to accommodate the different key size?
3. I read the document, say, iv length is the block size, right?
4. should we keep  iv and key the same size each time when we encrypt or
decrypt?e.g.  iv[16], key[16].....
5.I try to use the dynamic iv and key, not static, but always produce a
error, for example, I define,
byte iv =new byte[16];
byte key=new byte[16];
always get error, but afer I change iv and key to iv[16], key[16],
everything works well. do not know why?

thanks everyone, I am a newbie, sorry to bother.


----- Original Message ----- 
From: "Giuliano Bertoletti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 15, 2003 8:54 AM
Subject: Re: questions on data block size?


>
>
> > David Huang wrote:
> >
> > Hi there,
> >
> > I need to use the AES symmetric algorithm, RSA algorithm to encrypt
> > large data string or file, like 300k, or 1M.
> > right now, I have finished the AES(
> > CBCPaddedEncryptor/CBCPaddedDecryptor) and RSA(RSAES_PKCS1v15)
> > algorithms development, but can only encrypt limlited length of data.
>
> AES is a block cipher, RSA is a public key cryptosystem. Although they
> can both be used to encrypt/decrypt data, they're typically used in very
> different environments for different purposes.
>
> From what you're writing, it seems you're going to interchange one
> another. That would be a mistake.
>
> Please make a step backward and tell us which problem you need to solve,
> starting from what you want to obtain, not how.
>
> > So, I need to devide those large "string" into blocks. but I do not
> > know how to determine the sizes of blocks.
> > for example, we use RSA to encrypt data, if the key size is 512, what
> > block size I should to choose?, if key size is 2048, what another
> > block size I should choose? is there any equations in this library
> > that I can calculate it?
>
> You're trying to make improper use of the RSA-PKCSv1.5 scheme.
>
> >
> > for the AES CBC block cipher, should we keep the "iv" and "key" the
> > same?
>
> Definitly not, the IV is typically transmitted in clear, while the key
> is not, and sometimes not even trasmitted at all.
>
>
> -- 
> Giuliano Bertoletti
> e-Security Manager
>
>
> Intrinsic - Security Monitoring
> http://www.intrinsic.it
>
> COOL-FIRE: la soluzione Firewall per Windows NT/2000
> http://www.symbolic.it/Prodotti/cool-fire.html
>
> SYMBOLIC S.p.A. Tel: +39 0521 776180 / Fax: +39 0521 776190
>
>
>

Reply via email to