Home Forums ActiveX components Xceed Encryption for ActiveX How do I estimate the size of encrypted/decrypted data?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #43029 |

    These formulas will help you estimate the size of encrypted/decrypted data :

    PTS : Plain text size (in bytes)
    CTS : Cipher text size (in bytes)
    IVS : Initialization vector size (in bytes)
    KPS : Key Pair size (in bits). The one passed to SetRandomKeyPair.

    Twofish/Rijndael
    —————-
    Free blocks : CTS = PTS + PADDING -> CTS = PTS + 16 – ( PTS MOD 16 )
    Chained blocks : CTS = PTS + IVS + PADDING -> CTS = PTS + 16 + 16 – ( PTS MOD 16 )

    RSA-OAEP
    ——–
    The following formula should work in all cases except if PTS = 0

    MaxPTSBlock = CEILING( KPS / 8 ) – 43, where 43 is the OAEP hash size + padding.

    CTS : CEILING( PTS / MaxPTSBlock ) * CEILING( KPS / 8 ) + FLOOR( PTS / MaxPTSBlock )

    Imported from legacy forums. Posted by Xceed admin (had 1787 views)

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.