Skip to content

Instantly share code, notes, and snippets.

Created July 9, 2020 08:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
public static void entschluesseln(int code, char[] klein, char[]gross){
String datei1 = dateiAbfragen("Geben Sie den Dateinamen des verschlüsselten Texts ein:");
String datei2 = dateiAbfragen("In welcher Datei möchten Sie den unverschlüsselte Text speichern?");
String inhalt = dateiEinlesen(datei1);
char[] charArray = inhalt.toCharArray();
String ausgabe = "";
for(int i = 0; i < charArray.length; i++){
for (int j = 0; j < klein.length; j++){
if (charArray[i] == klein[j]){
charArray[i] = klein[(j - code) % klein.length];
else if (charArray[i] == gross[j]){
charArray[i] = gross[(j - code) % gross.length];
dateiSchreiben(new String(charArray), datei2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment