How to do ECB mode when dealing with RSA? I dont understand it. The Aadhar authentication doc (http://uidai.gov.in/images/FrontPageUpdates/aadhaar_authentication_api_1_6.pdf Page 33) says that we have to use RSA/ECB/PKCS1Padding but I am not finding any references to mode when dealing with RSA.
- We generate a AES-256 session key on server and send to client. (We forget the session key)
- Client encrypts his data block with symmetric AES/ECB/PKCS7Padding (using cryptojs)
- Client encrypts his session key with 2048-bit Aadhar public key using asymmetric algorithm (RSA/ECB/PKCS1Padding)
- Client also calculates HMAC of Data Block
- Client sends us the three fields, the server fills in other data and sends to Aadhar server
If somebody can tell me if the Forge library's example
var encrypted = publicKey.encrypt(bytes, 'RSAES-PKCS1-V1_5');
uses ECB or not. There are references to RSA/ECB/OAEPWithSHA-256AndMGF1Padding but I need PKCS#1 padding
Can you suggest me any other library or tell me proper code in Forge?
If I can do this in PHP on server side then also I can send session key and encrypted session key to client and then forget the session key.
I donot understand much cryptography but understand the terms somewhat.