2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
6 package org
.pmwiki
.cookbook
.aescrypt
;
8 import junit
.framework
.TestCase
;
16 public class PmWikiTest
extends TestCase
{
18 public PmWikiTest(String testName
) {
22 protected void setUp() throws Exception
{
26 protected void tearDown() throws Exception
{
31 157,150,47,15,254,201,114,195,231,120,61,61,128,55,254,200,157,150,47,15,254,201,114,195,231,120,61,61,128,55,254,200
36 public void testMain() throws Exception
{
38 System
.out
.println("Original cookbook/aescrypt recipe keys");
39 assertEquals(32, keyDataInt
.length
);
41 keyData
= new byte[keyDataInt
.length
];
42 for (int i
=0 ; i
< keyDataInt
.length
; i
++) {
43 keyData
[i
] = (byte) keyDataInt
[i
];
46 //String password = "TopSecret";
48 assertEquals("abcdefghijklmnopqrstuvwyz ",
49 AesCrypto
.decryptFromBase64RawKey("NIVjTk5OTk56djkEMVROFPZNCJHpBRL40DIgUK0xxsSh+A==", keyData
));
51 assertEquals("abcdefghijklmnopqrstuvwyz ",
52 AesCrypto
.decryptFromBase64RawKey("SIdjTtzc3NxGUSy001bgrExMOByI4NE6SWDJj3FycLwa6A==", keyData
));
55 AesCrypto
.decryptFromBase64RawKey("1ohjTsnJycmALuk=", keyData
));
57 assertEquals(" Encrypt this text ",
58 AesCrypto
.decryptFromBase64RawKey("jvJ5Tnl5eXnpdK89gmpkiWxjkmi73OoGc72C", keyData
));