代码:
import java.io.IOException;
import java.lang.reflect.Field;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class myTest {
public static void main(String[] args) throws IOException {
byte[] bytes= FileTools.readFile(path);
byte[] rbytes=new byte[bytes.length];
int i=0;
for (byte bt:bytes)
{
if(i!=0 && i % 16==0)
{
System.out.print("\n");
}
System.out.printf("%02X ",bt);
rbytes[bytes.length-i-1]=(byte) (bytes[i]^ 0x67); //加密
i++;
}
i=rbytes.length-1;
int k=0;
for (;i>=0;i--)
{
if(k!=0 && k % 16==0)
{
System.out.print("\n");
}
System.out.printf("%02X ",(byte)(rbytes[i]^ 0x67));//解密
k++;
}
}
}