Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added noEC encryption/decryption and basic tests

  • Loading branch information...
commit a4fb2aba3cb2f3dc97b7d69924501e5b669910bd 1 parent f2479e5
@dbasch authored
Showing with 31 additions and 0 deletions.
  1. +31 −0 src/test/java/com/fruitcat/bitcoin/BIP38Test.java
View
31 src/test/java/com/fruitcat/bitcoin/BIP38Test.java
@@ -0,0 +1,31 @@
+package com.fruitcat.bitcoin;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertEquals;
+
+/**
+ * Unit tests
+ *
+ */
+public class BIP38Test {
+
+ //EC multiply, no compression, no lot/sequence numbers
+ @Test
+ public void decryptECNoCompressionNoLotTest() throws Exception {
+ String encryptedKey = "6PfQu77ygVyJLZjfvMLyhLMQbYnu5uguoJJ4kMCLqWwPEdfpwANVS76gTX";
+ String pass = "TestingOneTwoThree";
+ String key = "5K4caxezwjGCGfnoPTZ8tMcJBLB7Jvyjv4xxeacadhq8nLisLR2";
+ String decryptedKey = BIP38.decrypt(pass, encryptedKey);
+ assertEquals(key, decryptedKey);
+ }
+
+ @Test
+ public void decryptNoECNoCompression() throws Exception {
+ String encryptedKey = "6PRVWUbkzzsbcVac2qwfssoUJAN1Xhrg6bNk8J7Nzm5H7kxEbn2Nh2ZoGg";
+ String pass = "TestingOneTwoThree";
+ String key = "5KN7MzqK5wt2TP1fQCYyHBtDrXdJuXbUzm4A9rKAteGu3Qi5CVR";
+ String decryptedKey = BIP38.decrypt(pass, encryptedKey);
+ assertEquals(key, decryptedKey);
+
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.