Tool to decrypt/encrypt using prime numbers. The Prime Numbers cipher consists in associating each character a prime number (2, 3, 5, 7, 11, …)
Prime Numbers Cipher - dCode
Tag(s) : Substitution Cipher
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Substitution by prime numbers, as the name suggests, is a cipher in which letters are replaced by prime numbers. By default, replace the 26 letters of the alphabet with the 26 first prime numbers (A=2, B=3, C=5, D=7, …, Z=101).
The encryption uses a correspondence between prime numbers and letters.
A | 2 | B | 3 | C | 5 | D | 7 | E | 11 | F | 13 | G | 17 | H | 19 | I | 23 | J | 29 | K | 31 | L | 37 | M | 41 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
N | 43 | O | 47 | P | 53 | Q | 59 | R | 61 | S | 67 | T | 71 | U | 73 | V | 79 | W | 83 | X | 89 | Y | 97 | Z | 101 |
Example: DCODE is crypted 7,5,47,7,11
Decryption requires knowing the correspondence used between prime numbers and letters. By default,A=2, B=3, C=5, …
Example: The cipher message 53,61,23,41,11 will be decrypted into PRIME
The message is only made of prime numbers, mainly the first 26 prime numbers: $ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101 $
It is possible to define an alternative correspondence (or random) between prime numbers and letters.
Example: Random substitution: A=17, B=43, C=101, D=3, etc.
To decode this alternative, convert the numbers into letters using the decryption form and then perform a monoalphabetic substitution.
The prime multiplication cipher (rarely called South African Scouts Cipher) uses prime numbers that are multiplied together. A prime decomposition is necessary.
Example: 110 = 2*5*11 = A,C,E.
In this case, the order of letters is not necessarily preserved (ACE=2*5*11=110 and ECA=11*5*2=110 too), an anagram generator or a permutations generator is useful to find back the right permutation of letters.
dCode retains ownership of the "Prime Numbers Cipher" source code. Except explicit open source licence (indicated Creative Commons / free), the "Prime Numbers Cipher" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Prime Numbers Cipher" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Prime Numbers Cipher" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Prime Numbers Cipher" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Prime Numbers Cipher on dCode.fr [online website], retrieved on 2024-12-04,