Encipher and Decipher implementation for Deno.
- Vigenere
- ADFGVX
- ADFGX
- Affine
- Atbash
- Autokey
- Beaufort
- Caesar
- ColumnarTransposition
- FourSquare
- FractionatedMourse
- PlayFair
- PolybiusSqaure
- Porta
- RailFence
- Rot13
- RunningKey
- Substitution
import { toVigenere, fromVigenere } from 'mod.ts';
toVigenere("key", "string"); // "CXPSRE"
fromVigenere("key", "CXPSRE"); // "string"-
Vigenere
- key should be alphabetic.
-
ADFGVX
- key < 36 in length.
- key should not contain repeated chars.
- key and keyword should be a valid ascii.
-
ADFGX
- key < 25 in length.
- key should not contain repeated chars.
- key and keyword should be a valid ascii.
-
Affine
ashould be in the range [1, 25].bshould be in the range [1, 25].ashould not be relatively prime to 26.
-
Atbash
- no rules
-
AutoKey
- key should be alphabetic.
-
Beaufort
- key should be alphabetic.
-
Caesar
- no rules
-
ColumnarTransposition
- key should be a valid ascii.
-
FourSquare
- alphabet, key1, key2 should be 25 chars in length.
- alphabet should be a valid ascii.
- alphabet, key1, key2 should not contain repeated chars.
- All of the chars in key1 and key2 should be in alphabet.
- pad should be contained in alphabet.
-
Playfair
- key should 25 chars in length.
- key should be a valid ascii.
- key should not contain repeated characters.
- pad should not be contained within key.
-
PolybiusSqaure
- key should be a valid ascii.
- key should not contain repeated characters.
- chars should be a valid ascii.
- chars should not contain repeated characters.
- length of chars should be equal to
sqrt(key.length()), and key should be of lengthchars.length()^2.
-
Porta
- key should be alphabetic.
-
RailFence
- key should not be less than or equal to 0.
-
RunningKey
- key should be alphabetic.
-
Substitution
- key should be 26 characters in length.
- key should not contain repeated chars.
- key should be alphabetic.
$ deno run -A scripts/build.tsRequires wasm.js to be built first.
$ deno testPull request, issues and feedback are very welcome. Code style is formatted with deno fmt and commit messages are done following Conventional Commits spec.
Copyright 2020, Divy Srivastava. All rights reserved. MIT license.
