public String encrypt(String line) throws UnsupportedEncodingException {
String newLine = "";
byte[] bytes = line.getBytes("UTF-8");
for (byte c : bytes) {
newLine += Integer.toHexString(c);
}
System.out.println(newLine);
return newLine;
}
public String decrypt(String line) throws UnsupportedEncodingException {
String newLine = "";
byte[] bytes = line.getBytes("UTF-8");
for (byte b : bytes) {
char c = (char) b;
newLine += c;
}
return newLine;
}
These are the two methods. don't know how to correct this. so can make it correct and how? I want covert the returned line of encrypt to normal line in decrypt method