const Cryptr = require('cryptr');
const cryptr = new Cryptr('ReallySecretKey');
const encryptedString = cryptr.encrypt('Popcorn');
const decryptedString = cryptr.decrypt(encryptedString);
console.log(encryptedString);
var secret = "My Secret Passphrase";
var plainText = "the brown fox jumped over the lazy dog";
var encrypted = CryptoJS.AES.encrypt(plainText, secret);
var decrypted = CryptoJS.AES.decrypt(encrypted, secret);
document.getElementById("m1").innerHTML = encrypted;
document.getElementById("m2").innerHTML = decrypted;
document.getElementById("m3").innerHTML = decrypted.toString(CryptoJS.enc.Utf8);
function getMessageEncoding() {
const messageBox = document.querySelector(".rsa-oaep #message");
let message = messageBox.value;
let enc = new TextEncoder();
return enc.encode(message);
}
function encryptMessage(publicKey) {
let encoded = getMessageEncoding();
return window.crypto.subtle.encrypt(
{
name: "RSA-OAEP"
},
publicKey,
encoded
);
}
const oracledb = require('oracledb');
oracledb.initOracleClient({configDir: '/etc/my-oracle-config'});