All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
Adds an optional real encryption mode, which encrypts pages using AES, without saving plaintext. Re-implements the old magic encryption in non-real encryption mode. Fixes incorrect key generation for use in the substitution cipher and the gene cipher. Removes the option for saving books as txt. Adds tests for all encryption methods. Saves all necessary decryption data when storing encrypted books. Removes the old book updating code.
23 lines
558 B
Java
23 lines
558 B
Java
package net.knarcraft.bookswithoutborders;
|
|
|
|
import net.knarcraft.bookswithoutborders.encryption.GenenCrypt;
|
|
import org.junit.Test;
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
import static org.junit.Assert.assertNotNull;
|
|
|
|
public class GenenCryptTest {
|
|
|
|
@Test
|
|
public void encryptDecryptTest() {
|
|
GenenCrypt gc = new GenenCrypt("Another Key");
|
|
gc.printCodonTable();
|
|
String encrypted = gc.encryptText("Hello World!");
|
|
|
|
assertNotNull(encrypted);
|
|
|
|
assertEquals("HELLO WORLD!", gc.decryptText(encrypted));
|
|
}
|
|
|
|
}
|