Recently I was using Bouncy Castle and Crypto++ to do some ECC decryption & encryption
After all the effort I make finally I implements the basic function : generate key pair, decrypt and encrypt text. They are implements in both C++ (using Crypto++) and Java (using Bouncy Castle), but I found these 2 projects' implements were rather different.
So here are my two related questions:
In JAVA I need to create 2 pair of keys, I don't know why I should create 2 pair of keys? Here is another user ask the same question another same question on stackoverflow.What's the point to use 2 pair of keys?
I encrypt & decrypt a string(10 bytes) by both JAVA and C++, of course, follow the example code. In Java I generate 2 pair of keys on the curve prime256k1. In C++ I generate a pair of keys on the curve secp256k1. The length of the keys are both 256 bit. When I get my encrypted text, I found the Java encrypted text's length is about 30 bytes, but the C++ length of the encrypted text is about 100 bytes. What makes these so different? Maybe because the 2 pair of keys? If so, why?