cryptography
cryptography copied to clipboard
How to convert a string version of public key to PublicKey object for diffie Hellman
I am using node js server to send it's public key to the flutter app, but it returns the value as a string, how to deal with that?
Hello send the publickey from nodejs server as base64 encoded and decode it in your flutter app side then use the constructor of SimplePublicKey(public key decoded as bytes , type of the algorithm you use)
final type = DartX25519().keyPairType;
final spk = SimplePublicKey(publicKeyDecoded , type);