@Override public String randomlyEncrypt(String plainText) { do { try { int size = RandomUtil.pickRandomInt(2, 4); return encode( plainText, KeyGeneration.createMatrix(size, 26), KeyGeneration.createMatrix(size, 1, 26)); } catch (MatrixNoInverse noInverse) { } } while (true); }
@Override public Solution generateKey() { this.bestMaximaKey = KeyGeneration.createPolluxKey(); return new Solution(Pollux.decode(this.cipherText, this.bestMaximaKey), this.getLanguage()); }