zoukankan      html  css  js  c++  java
  • 使用kettle转换中的JavaScript对密码进行加密和解密

    日常开发中,为了确保账号和密码的安全,时常要对密码进行加密和解密。然而kettle是怎么对密码进行加密和解密的呢?

    下面的代码需要再转换中的JavaScript中运行。

    var encrypted_password = 'not encrypted';
    
    加密(js中调用):
    encrypted_password = "Encrypted " + Packages.org.pentaho.di.core.encryption.Encr.encryptPassword(clear_password);
    
    命令行生成密码:F:pdi-open-3.1.0-826/Encr.bat
    
    F:pdi-open-3.1.0-826>encr -kettle abc
    Encrypted 2be98afc86aa7f2e4cb79ce10be93add9
    F:pdi-open-3.1.0-826>
    
    解密:
    if(value.startsWith("Encrypted ")){
          setValue = org.pentaho.di.core.encryption.Encr.decryptPasswordOptionallyEncrypted(value);
    }
  • 相关阅读:
    Sigmoid函数
    Softmax分类器
    正则化惩罚项
    损失函数
    交叉验证
    超参数
    IMAGENET
    hdu 2767 Proving Equivalences 强连通
    hdu 4587 TWO NODES 关节点
    hdu 3635 Dragon Balls 并查集
  • 原文地址:https://www.cnblogs.com/rwxwsblog/p/4529078.html
Copyright © 2011-2022 走看看