You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great flutter RSA library! I have a question may be stupid... When we encrypt or decrypt a file lang than the key size, how can we know the length(128Bytes or 256Bytes) of the private key or public key? I didn't find this api in the library...
The text was updated successfully, but these errors were encountered:
HI @KeithMorning at this moment there is no method to obtain the information of the keys, I think it would be useful a method like this, I will investigate about it to see how it can be implemented in these days
note: if you create a key using the Generate method you'll know that value but it's probably not what you need
In most programming languages, the PrivateKey and PublicKey entity (class, struct, whatever it's called) usually have Size or Length property/field or something similar.
the key length can be either shown in bit(2048) or in Byte(2048/8 = 256)
the max length of the data that can be encrypted is calculated like this (all sizes are in Byte) :
max lenght for PKCS1v15 = publickKey.Size - 11
max length for OAEP = publicKey.Size - (hash.Size*2) - 2
for example, if we have RSA 2048 key we have:
size of RSA-2048 = 256
size of SHA265 = 32
for PKCS1v15256 - 11 = 245
for OAEP256 - (32*2) - 2 = 190
Great flutter RSA library! I have a question may be stupid... When we encrypt or decrypt a file lang than the key size, how can we know the length(128Bytes or 256Bytes) of the private key or public key? I didn't find this api in the library...
The text was updated successfully, but these errors were encountered: