We realize the class ClientEncryptedText, which contains a methdo main that uses the class EncryptedText:
public class ClientEncryptedText { public static void main(String[] args) { EncryptedText t = new EncryptedText("Nel mezzo del cammin di ...", 10); System.out.println(t.getEncryptedText()); System.out.println(t.getDecryptedText(10)); t.setKey(10,20); System.out.println(t.getDecryptedText(10)); System.out.println(t.getDecryptedText(20)); } }
The output of the program is the following:
Xov*wo??y*nov*mkwwsx*ns*888 Nel mezzo del cammin di ... null Nel mezzo del cammin di ...