Decrypt
Wander Injected API decrypt() function
Argument
Type
Description
Example usage
// connect to the extension
await window.arweaveWallet.connect(["ENCRYPT", "DECRYPT"]);
// encrypt data using RSA-OAEP
const encrypted = await arweaveWallet.encrypt(
new TextEncoder().encode("This message will be encrypted"),
{ name: "RSA-OAEP" }
);
console.log("Encrypted bytes:", encrypted);
// now decrypt the same data using
// the same algorithm
const decrypted = await arweaveWallet.decrypt(
encrypted,
{ name: "RSA-OAEP" }
);
console.log(
"Decrypted data:",
new TextDecoder().decode(decrypted)
);Old (deprecated) usage
Last updated
Was this helpful?