All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.drc.utils.CipherUtils Maven / Gradle / Ivy

There is a newer version: 5.0.0.1-cloud.beta
Show newest version
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()));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy