kettle 数据库密码解密

  • Post author:
  • Post category:其他


1.找出加密后的密码:C:\Users\.kettle\shared.xml文件中找到加密的密码;

2.java代码解密

首先添加kettle相关maven依赖

<!-- 缺少的jar包自行添加 -->
<dependency>
   <groupId>pentaho-kettle</groupId>
   <artifactId>kettle-core</artifactId>
   <version>8.1.0.0-365</version>
</dependency>
<dependency>
   <groupId>pentaho-kettle</groupId>
   <artifactId>kettle-engine</artifactId>
   <version>8.1.0.0-365</version>
</dependency>

<dependency>
   <groupId>pentaho</groupId>
   <artifactId>metastore</artifactId>
   <version>8.1.0.0-365</version>
</dependency>

加密代码:

import org.pentaho.di.core.KettleEnvironment;
import org.pentaho.di.core.encryption.Encr;
import org.pentaho.di.core.exception.KettleException;

/**
 * 破解kettle加密后的密码
 */
public class CrackPwd {

    public static void main(String[] args) {
        try {
            KettleEnvironment.init();
            String pwd = "Encrypted 2be98afc86aa7f2e4cb79f62886caf782";
            System.out.println("解码前密码:" + pwd);
            String decryptPassword = Encr.decryptPassword(pwd);
            System.out.println("解码后密码:" + decryptPassword);
        } catch (KettleException e) {
            e.printStackTrace();
        }
    }
}

控制台打印:



版权声明:本文为dong__CSDN原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。