package com.bizzan.bitrade;

import java.io.IOException;

import org.elasticsearch.common.Base64;
import org.jasypt.util.text.BasicTextEncryptor;
import org.junit.Test;

public class CommonTest {

	@Test
	public void testMM() {
		BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
        //密钥
        textEncryptor.setPassword("foxf5f4b8a31ea3f7dfec4");
        //要加密的数据（数据库的用户名或密码）
        String username = textEncryptor.encrypt("vom7nm6u87J1R6vfk");
        String password = textEncryptor.encrypt("6u4c1o1hg3yf8se");
        String key = textEncryptor.encrypt("65vf73zmw7n");
        System.out.println("username:"+username);
        System.out.println("password:"+password);
        System.out.println("key:"+key);
        System.out.println("username:"+textEncryptor.decrypt(username));
	}
	
	@Test
	public void testBase64() throws IOException {
		System.out.println(Base64.decode("2AvVhdsgUs0FSA3SDFAdag==").length);
		System.out.println(Base64.encodeBytes("xf5f4b8a31e12345".getBytes()));
	}
}
