I am trying to decrypt my private key bytes using the KeyCrypter
interface. But i do not know how to implement and call the decrypt()
function. Initially i encrypt the bytes of my Private Key of my ECKey
.
Here is my code:
private ECKey myKey;
private CharSequence password = "myPassword";
public KeyParameter deriveKey(CharSequence password)
throws KeyCrypterException {
String s = password.toString();
KeyParameter keyParameter = new KeyParameter(s.getBytes());
return keyParameter;
}
public EncryptedData encrypt(byte[] plainBytes,
org.spongycastle.crypto.params.KeyParameter aesKey)
throws KeyCrypterException {
plainBytes = myKey.getPrivKeyBytes();
EncryptedData myData = new EncryptedData(plainBytes, aesKey.getKey());
System.out.println(myData);
return myData;
}
public byte[] decrypt(EncryptedData encryptedBytesToDecode,
KeyParameter aesKey) throws KeyCrypterException {
// TODO Auto-generated method stub
return null;
}
which is the byte [] result=...returning from my decrypt()
function?