Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fly;
- /**
- * Klasse übernimt das ver und entschlüsseln der Codes
- * @author cedric
- */
- public class Cryption {
- public String inputAnzahl,inputText,senden,str2;
- FlyView fly = new FlyView();
- public String verschlüsseln(String arbeitstring1) {
- int faktor = fly.InputAnzahl();
- StringBuilder vText = new StringBuilder();
- for (int i9 = 0; i9 < arbeitstring1.length(); i9++) {
- vText.append((char) (arbeitstring1.charAt(i9) + faktor + i9));
- }//end of For
- str2 = ("" + vText);
- //inputText.setText("Fehler beim verschlüsseln");
- return str2;
- }//end of verschlüsseln
- public String entschlüsseln(String arbeitstring3) {
- int faktor = fly.InputAnzahl();
- StringBuilder eText = new StringBuilder();
- for (int i8 = 0; i8 < arbeitstring3.length(); i8++) {
- eText.append((char) (arbeitstring3.charAt(i8) - faktor - i8));
- }//end of For
- senden = (""+ eText);
- //inputText.setText("Fehler beim entschlüsseln");
- return senden;
- }//end of entschlüsseln()
- }//end of class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement