A lot of people do that. And the majority get burned.
Probably the best example: Brainwallets.
I am not anyone and ho fucking dear, I have seen that name which i will come too.
The point is that it is senseless to create an 'encryption' which can easily be reverted.
I don't think I have many other options, encryption is ten a penny but unfortunately not just anyone will do.
I pulled the bitcoin Secp256k1 from a windows library and I use that for key exchange because it is second to none
but after that the code in Bitcoin uses AES for the signature from what I had seen. Here is the code that's in the project I pinched the Secp256k1 from.
private byte[] DecryptData(byte[] Key, byte[] IV, byte[] cipher)
{//RijndaelManaged AES decryption
aesEncryption.IV = IV;
aesEncryption.Key = Key;
ICryptoTransform decryptor = aesEncryption.CreateDecryptor();
byte[] decryptedData = decryptor.TransformFinalBlock(cipher, 0, cipher.Length);
return decryptedData;
}
I could dig deeper into this but here is another bit of code from the same project !
byte[] encryptedP = encryption.Encrypt(Settings.PrivateKey, publicKey, message);
byte[] decryptedP = encryption.Decrypt(Settings.PublicKeyPoint , encryptedP);
string decryptedMessageP = Encoding.UTF8.GetString(decryptedP);
byte[] encrypted = encryption.Encrypt(Settings.PublicKeyPoint, message);
byte[] decrypted = encryption.Decrypt(Settings.PrivateKey , encrypted);
string decryptedMessage = Encoding.UTF8.GetString(decrypted);
MessageSignerVerifier messageSigner = new MessageSignerVerifier();
SignedMessage signedMessage = messageSigner.Sign(privateKeyBig, "Test Message to sign, you can verify this on http://brainwallet.org/#verify");
bool verified = messageSigner.Verify(signedMessage);
The header for encryption reads
{
private readonly ECDsaSigner signer = new ECDsaSigner();
private ECElGamal ecElGamal = new ECElGamal();
private RijndaelManaged aesEncryption = new RijndaelManaged();
private RNGCryptoServiceProvider rngCsp = new RNGCryptoServiceProvider();.............
This is why I stated that Bitcon uses AES after key exchange but now I have to question this myself
but this project I pulled this code from is quite a common one so I am not sure what to make of this.