@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);
 }
Exemplo n.º 2
0
 @Override
 public String randomlyEncrypt(String plainText) {
   return encode(plainText, RandomUtil.pickRandomInt(1, 25));
 }