How to use the jsencrypt function in jsencrypt

To help you get started, we’ve selected a few jsencrypt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fengcms / python-learn-demo / news / fe-manage / src / tool / rsa.js View on Github external
export default str => {
  let encrypt = new JSEncrypt()
  encrypt.setPublicKey(key)
  // console.log(str)
  return encrypt.encrypt(str)
}
github lazyboyl / bg-admin / bg-admin-web / src / main.js View on Github external
Vue.prototype.$encruption = function (obj) {
  let encrypt = new JsEncrypt();
  encrypt.setPublicKey(
    `-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDyKmfJhgAHEK0Yo6qOtFB8sSfYIZBJUyyXi1X7EgkZo3kmMOu6/uT7SwC9EnqbiMySJfAlvB200ZMIk6e1NQrPLZpc5VSuzSQ3NqdXOdbNnhXAUeME8IcsbscK9XP8BxldMhUhIK+3zovI1VCY2kLO6TMwEVvTdH+F1jW/WFkplwIDAQAB-----END PUBLIC KEY-----`
  )
  return encrypt.encrypt(obj);
};
github datash / datash / src / client / encryption / index.js View on Github external
export const decryptAsymmetric = (privateKey, encryptedText) => {
  const crypt = new JSEncrypt();
  crypt.setPrivateKey(privateKey);
  return crypt.decrypt(encryptedText);
};
github Chenwe-i-lin / KnowledgeFruits / manager / src / pages / register / register.vue View on Github external
encrypt(publicKey, password) {
      var en = new JSEncrypt();
      en.setPublicKey(publicKey);
      return en.encrypt(password);
    },
    verify() {
github datash / datash / src / client / encryption / index.js View on Github external
export const encryptAsymmetric = (publicKey, actualText) => {
  const crypt = new JSEncrypt();
  crypt.setPublicKey(publicKey);
  return crypt.encrypt(actualText);
};
github datash / datash / src / client / encryption / index.js View on Github external
export const generateAsymmetricKeyPair = (keySize = 1024) => {
  const crypt = new JSEncrypt({ default_key_size: keySize });
  const keys = crypt.getKey();
  return {
    privateKey: keys.getPrivateKey(),
    publicKey: keys.getPublicKey()
  };
};

jsencrypt

A Javascript library to perform OpenSSL RSA Encryption, Decryption, and Key Generation.

MIT
Latest version published 2 years ago

Package Health Score

61 / 100
Full package analysis