I with my beginner skils in Java, can’t figure out how to encrypt text. Yes I do know that there are alot of libraries and APIS, but this time I want to do this ny way so I understand everything perfectly.
So my idea and question is how to assign values to characters and later use them (encrypt and decrypt). For example A = 12; B = 13; C = 14; D = 15. So DBAC would be 15131214
So far I made this program that just increases character by one, but I cant figure out how to assign diferent values.
package javaapplication2;
public class JavaApplication2 {
public static void main(String[] args) {
int b;
String text = "criptable text";
char[] textArray = text.toCharArray();
for(int index=0; index < textArray.length;index++){
textArray[index]++;
}
String done = new String (textArray);
System.out.println(done);
}
}
You might be looking for something like this?
}