Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static String encrypt(String key, String value) {
        String result = null;
        //result = value
        String str = key + value;
        result = new String(encodeBase64(str));//str.bytes.encodeBase64().toString();
        return result;
    }

    protected static byte[] encodeBase64(String value) {
        byte[] result = null;
        byte[] binaryData = value.getBytes();
        result = org.apache.commons.codec.binary.Base64.encodeBase64(binaryData);
        //      result = str.bytes.encodeBase64().toString();
        return result;
    }
}