aboutsummaryrefslogtreecommitdiffhomepage
path: root/TestEncryption.php
diff options
context:
space:
mode:
authormarvin-borner@live.com2018-04-11 17:02:06 +0200
committermarvin-borner@live.com2018-04-11 17:02:06 +0200
commita935f6bc393490d02119e9c6cbc62787b3656fac (patch)
tree103437649bb87b5f669a82f1f52e4aacf5f238f2 /TestEncryption.php
parent355723a70ed5750c12a0877f40401e2e4cae4aa9 (diff)
Added JSON as transport type - begin JS encryption
Diffstat (limited to 'TestEncryption.php')
-rw-r--r--TestEncryption.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/TestEncryption.php b/TestEncryption.php
new file mode 100644
index 0000000..e4a9085
--- /dev/null
+++ b/TestEncryption.php
@@ -0,0 +1,31 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport"
+ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <title>Document</title>
+</head>
+<body>
+
+
+
+<script src="assets/js/encryption.js"></script>
+<script>
+ // The passphrase used to repeatably generate this RSA key.
+ var PassPhrase = "The Moon is a Harsh Mistress.";
+
+ // The length of the RSA key, in bits.
+ var Bits = 1024;
+
+ var MattsRSAkey = cryptico.generateRSAKey(PassPhrase, Bits);
+ var MattsPublicKeyString = cryptico.publicKeyString(MattsRSAkey);
+
+ var PlainText = "Matt, I need you to help me with my Starcraft strategy.";
+ var EncryptionResult = cryptico.encrypt(PlainText, MattsPublicKeyString);
+
+ console.log(EncryptionResult.cipher);
+</script>
+</body>
+</html> \ No newline at end of file