Skip to content

peppermintbird/cipher-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 

Repository files navigation

⚗️

Text ecryption with phonemic cipher and symbolic algorithm

🚧 Under development

How it works

Night Cipher works as the input word is phonemically encoded and then translated into symbols and positions represented by numbers using a symbol system that I explain further on.

The encrypting system of Night Cipher inherits the core idea of substitution from Caesar's Cipher. In Caesar's Cipher, each letter in the plaintext is shifted by a fixed number of positions in the alphabet. In Night Cipher, however, the position of a letter is assigned by its location in a container represented by a symbol.

The symbol system

In this system, each batch of three letters (e.g., ABC, DEF...), being Y Z the exception, is defined as a container, which in turn is represented by a symbol.

The symbols are disposed as follows,


We began by defining a function to encrypt text using a custom encryption logic which maps each letter in its symbol container and the corresponding symbol. Below, we have a character (e.g., 'A', 'B', 'C'...) defined by an array. The first element of this array represents the position and the second element represents the symbol associated with the character.

// Encryption algorithm mapping
const symbolMapping = {
    'A': ['1', '!'],
    'B': ['2', '!'],
    'C': ['3', '!'],
    'D': ['1', '@'],
    'E': ['2', '@'],
    'F': ['3', '@'],
    'G': ['1', '#'],
    'H': ['2', '#'],
    'I': ['3', '#'],
    .
    .
    .

Problems

Despite its functionality, Night Cipher has some issues that need to be addressed:

  • It was first designed for the English alphabet, so it may not work properly with characters from other languages or non-alphabetic characters.
  • The encryption algorithm's length can be inconsistent and inefficient, especially with duplication of characters.
    • An alternative approach, inspired by run-length encoding, could potentially address this issue by compressing repetitive sequences of characters.

About

Experiments with text encrypters using symbolic encryption algorithm.

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •