SCRT-HQ / PEMEncrypt

PEMEncrypt is a cross-platform PowerShell module handling string encryption and decryption using RSA keys only.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Longer strings are not supported

praus opened this issue · comments

Hi! I just wanted to drop a friendly note that your library won't be able to encrypt strings longer than the key modulus size in bytes minus padding size (11 bytes for PKCS #1). For example, if your RSA key is 2048 bit long (therefore its modulus is 2048 bits/256 bytes), you will only be able to encrypt plaintexts that are 245 bytes in length or less. RSACryptoServiceProvider will throw CryptographicException when the plaintext is too long. You might want to point this out in the documentation.

Useful links:

Thanks for the pointer, @praus !!! I'll add it to the documentation!