com.aliyun.drc.utils.CipherUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client Show documentation
Show all versions of client Show documentation
The core java client for accessing Data Transmission Service
package com.aliyun.drc.utils;
import org.apache.commons.codec.binary.Base64;
/**
* Created by haikuo.zhk on 2017/6/5.
*/
public class CipherUtils {
public static String encrypt(String plainText) {
byte[] linebreak = {};
Base64 coder = new Base64(32, linebreak, true);
return new String(coder.encode(plainText.getBytes()));
}
public static String decrypt(String codedText) {
byte[] linebreak = {};
Base64 coder = new Base64(32, linebreak, true);
return new String(coder.decode(codedText.getBytes()));
}
}