On Feb 9, 10:20 pm, Leonardo Carreira <[email protected]> wrote: > Hi Jeff, > > I'm still struggling to solve this. > How to specify No Padding usage using Cryptopp? > Because i want to encrypt the data with length is the same with > modulus length. > As far as i know, in Cryptopp there're only 2 typedef option which can > be used, but all of these classes uses Padding.. > > typedef RSAES<PKCS1v15>::Decryptor RSAES_PKCS1v15_Decryptor; > typedef RSAES<PKCS1v15>::Encryptor RSAES_PKCS1v15_Encryptor; > > typedef RSAES<OAEP<SHA> >::Decryptor RSAES_OAEP_SHA_Decryptor; > typedef RSAES<OAEP<SHA> >::Encryptor RSAES_OAEP_SHA_Encryptor; > I think the long way (but probably the correct way) is to derive a class from PK_EncryptionMessageEncodingMethod (http://www.cryptopp.com/ docs/ref/class_p_k___encryption_message_encoding_method.html).
I think the shortest path would probably call ApplyFunction on InvertibleRSAFunction (InvertibleRSAFunction is a typedef for RSA::PrivateKey - see http://www.cryptopp.com/docs/ref/class_invertible_r_s_a_function.html and http://www.cryptopp.com/docs/ref/struct_r_s_a.html). So you are basically calling Encrypt with the private key. RSAFunction::ApplyFunction should perform the decrypt. I've never tried to write or run the code, though. Jeff [SNIP] -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com.
