Hello,
> is it possible to change the OpenSSL RSA functions so that I can use  
> a different - may be a variable - block size. At the moment the block  
> size on the OpenSSL RSA functions depends on the length of the RSA  
> key pair and the kind of padding (following PKCS#1 v1.5, which means  
> 11 byte random data):
> 
>       key lenght      block size      available space
> 
>       2024 bit                256 byte                245 byte
>       1024 bit                128 byte                105 byte
>       768 bit         96 byte         85
> 
> Normally, on symmetric encryption the block size _must_ be the same  
> as the key lenght.
Not exactly, for example:
 AES128: key: 16bytes, block: 16bytes
 AES192: key: 24bytes, block: 16bytes
 AES256: key: 32bytes, block: 16bytes
 DES3  : key: 24bytes, block: 8bytes
and of course des which has key_len == block_len:
 DES   : key: 8bytes,  block: 8bytes

>  But on asymmetric encryption methods - I think -  
> the block size not depends on that restriction, or is there another  
> point, which forces such a fixed block size?
Amount of data which may be encrypted with RSA depends on algorithm.
If you have private key (d,n) and public key (e,n) where n=p*q,
where p and q are prime numbers.
Encryption of plain P:
 C = P^e mod n
Decryption of cipher C:
 P = C^d mod n

As you see, you get always result as number from 0 to n-1 (modulo
operation) and n is RSA key size.
To be more specific, RSA operation is performed inside multiplicative
group.

Best regards,
-- 
Marek Marcola <[EMAIL PROTECTED]>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to