UNPKG
vernam-cipher
Version:
latest (0.1.0)
0.1.0
A toy Vernam Cipher implementation.
brianleroux/vernam-cipher
vernam-cipher
/
test.js
10 lines
(8 loc)
•
265 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
var
vernam =
require
(
'./index'
) , plaintext =
"hello world"
, key_and_cipher = vernam.
encrypt
(plaintext) , key = key_and_cipher[
0
] , ciphertext = key_and_cipher[
1
]
console
.
log
(plaintext)
console
.
log
(ciphertext)
console
.
log
(vernam.
decrypt
(key, ciphertext))