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.

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 LianjiaTech / fee / client / src / view / login / login.vue View on Github external
<script>
  import config from 'src/config'
  import JSEncrypt from 'jsencrypt'
  import { mapActions } from 'vuex'
  import LoginForm from '_c/login-form'
  import RegisterForm from '_c/register-form'
  import { register } from '@/api/user'

  const publicKey = config.publicKey

  const encrypt = new JSEncrypt()
  encrypt.setPublicKey(publicKey)

  export default {
    components: {
      LoginForm,
      RegisterForm
    },
    data() {
      return {
        showTip: '去注册',
        isLogin: true,
        loginType: 'uc'
      }
    },
    methods: {
      ...mapActions(['handleLogin', 'getUserInfo']),
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()
  };
};
github LianjiaTech / fee / client / src / view / MainPage / components / user / user.vue View on Github external
<script>
  import JSEncrypt from 'jsencrypt'
  import { mapActions } from 'vuex'
  import config from 'src/config/index'
  import { modifyPassword, modifyMessage, getLoginUserInfo, destroyAccount as apiDestroyAccount } from 'src/api/user'

  import './user.less'

  const publicKey = config.publicKey
  const encrypt = new JSEncrypt()
  encrypt.setPublicKey(publicKey)

  export default {
    name: 'User',
    mounted() {
      this.getLoginUserData()
    },
    data() {
      const checkNickname = (rule, value, next) => {
        if (value === '') {
          next(new Error('昵称不能为空'))
        } else if (value === this.nicknamePlaceholder) {
          next(new Error('昵称未修改'))
        } else {
          next()
        }

jsencrypt

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

MIT
Latest version published 1 year ago

Package Health Score

69 / 100
Full package analysis

Similar packages