Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/arosspope/cipher-crypt
/ functions
Functions
232 in github.com/arosspope/cipher-crypt
⨍
Functions
232
◇
Types & classes
19
↓ 15 callers
Method
is_valid
Will check if the text contains valid alphabetic symbols only.
src/common/alphabet.rs:39
↓ 14 callers
Method
find_position
(&self, c: char)
src/common/alphabet.rs:72
↓ 12 callers
Method
modulo
Performs a modulo on an index so that its value references a position within the alphabet. This function handles negative wrap around modulo as rust d
src/common/alphabet.rs:33
↓ 10 callers
Function
keyed_alphabet
Generates a scrambled alphabet using a key phrase for a given alphabet type. Lets consider the key `or0an3ge` for an alphanumeric alphabet. The result
src/common/keygen.rs:13
↓ 10 callers
Method
length
(&self)
src/common/alphabet.rs:91
↓ 10 callers
Function
playfair_table
Create a new Playfair key table The table is a 5x5 (I=J) matrix. Any repeated characters are removed and the key fills in the table from left to righ
src/common/keygen.rs:184
↓ 7 callers
Function
polybius_square
Generate a 6x6 polybius square hashmap from an alphanumeric key. For successfull generation, the following must be met: # Panics The `key` must have
src/common/keygen.rs:101
↓ 6 callers
Method
get_letter
(&self, index: usize, is_uppercase: bool)
src/common/alphabet.rs:79
↓ 6 callers
Function
shift_substitution
Performs a shift substitution of letters within a piece of text based on the index of them within the alphabet. This substitution is defined by the c
src/common/substitute.rs:12
↓ 4 callers
Function
key_substitution
Performs a poly-substitution on a piece of text based on the index of its characters (within the alphabet) and the keystream `k`. This substitution i
src/common/substitute.rs:39
↓ 3 callers
Function
columnar_key
Validate and return a Columnar Transposition key given a specific keystream. # Panics The `keystream` length is 0. The `keystream` contains non-alpha
src/common/keygen.rs:56
↓ 3 callers
Function
cyclic_keystream
Generate a cyclic keystream. For this, we simply repeat the key until we have enough symbols to encrypt all alphabetic symbols of the message.
src/common/keygen.rs:225
↓ 3 callers
Method
encrypt
Encrypt a message using a Porta cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Porta}; let v = Porta::new("melon".into()); assert_e
src/porta.rs:93
↓ 2 callers
Method
apply_rules
Apply the PlayFair cipher algorithm. The operations for encrypt and decrypt are identical except for the direction of the substitution choice.
src/playfair.rs:149
↓ 2 callers
Method
apply_slice
Apply rule 2 (Row) or rule 3 (Column). # Rule 2 If the letters appear on the same row of your table, replace them with the letters to their immediat
src/playfair.rs:234
↓ 2 callers
Method
bigram
Apply rule 1 (bigrams). # Rule 1 If both letters are the same (or only one letter is left), add the null_char after the first letter. Encrypt the ne
src/playfair.rs:182
↓ 2 callers
Function
decrypt
Decrypt a message using the Rot13 substitute cipher. # Examples Basic usage: ``` use cipher_crypt::Rot13; let m = "I am my own inverse"; assert_eq!
src/rot13.rs:38
↓ 2 callers
Method
decrypt
Decrypt a message using a Porta cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Porta}; let v = Porta::new(String::from("melon")); a
src/porta.rs:113
↓ 2 callers
Method
decrypt
Decrypt a message using a Vigenère cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Vigenere}; let v = Vigenere::new(String::from("gi
src/vigenere.rs:78
↓ 2 callers
Method
decrypt
Decrypt a message using a Caesar cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Caesar}; let c = Caesar::new(3); assert_eq!("Attack
src/caesar.rs:70
↓ 2 callers
Function
encrypt
Encrypt a message using the Rot13 substitute cipher. # Examples Basic usage: ``` use cipher_crypt::Rot13; let m = "I am my own inverse"; assert_eq!
src/rot13.rs:22
↓ 2 callers
Method
encrypt
Encrypt a message with a Columnar Transposition cipher. All characters (including utf8) can be encrypted during the transposition process. However, i
src/columnar_transposition.rs:74
↓ 2 callers
Method
encrypt
Encrypt a message using a Vigenère cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Vigenere}; let v = Vigenere::new(String::from("gi
src/vigenere.rs:54
↓ 2 callers
Method
encrypt
Encrypt a message using a Caesar cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Caesar}; let c = Caesar::new(3); assert_eq!("Dwwdfn
src/caesar.rs:47
↓ 2 callers
Function
find_corners
Identifies 2 corners of the rectangle.
src/playfair.rs:272
↓ 2 callers
Method
multiplicative_inverse
Finds the multiplicative inverse of an index such that `a*x = 1 (mod n)`. Where `a` is the number we are inverting, `x` is the multiplicative inverse,
src/common/alphabet.rs:55
↓ 2 callers
Method
scrub
Will scrub non-alphabetic characters from the text and return the scrubed version.
src/common/alphabet.rs:45
↓ 1 callers
Method
apply_rectangle
Apply rule 4 (Rectangle). # Rule 4 If the letters are not on the same row or column, replace them with the letters on the same row respectively but
src/playfair.rs:260
↓ 1 callers
Function
concatonated_keystream
Generate a concatonated keystream (key + message).
src/common/keygen.rs:232
↓ 1 callers
Function
decode_sequence
Attempts to decode a morsecode sequence into a character of the known alphabet. Will return None if the Morse code isn't present in the alphabet
src/common/morse.rs:60
↓ 1 callers
Method
decrypt
Decrypt a message using an Autokey cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Autokey}; let a = Autokey::new(String::from("fort
src/autokey.rs:75
↓ 1 callers
Method
decrypt
Decrypt a message using a Hill cipher. It is expected that this message contains alphabetic characters only. Due to the nature of the hill cipher it
src/hill.rs:167
↓ 1 callers
Function
encode_character
Attempts to convert a character into a morse code sequence Will return None if the character isn't present in the known alphabet
src/common/morse.rs:70
↓ 1 callers
Method
encrypt
Encrypt a message using the Baconian cipher The message to be encrypted can only be ~18% of the decoy_text as each character of message is encoded by
src/baconian.rs:193
↓ 1 callers
Method
encrypt
Encrypt a message using an Autokey cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Autokey}; let a = Autokey::new(String::from("fort
src/autokey.rs:51
↓ 1 callers
Method
encrypt
Encrypt a message using a Hill cipher. It is expected that this message contains alphabetic characters only. Due to the nature of the hill cipher it
src/hill.rs:111
↓ 1 callers
Function
get_code
Get the code for a given key (source character)
src/baconian.rs:117
↓ 1 callers
Function
get_key
Gets the key (the source character) for a given cipher text code
src/baconian.rs:136
↓ 1 callers
Function
is_numeric
Determines if the char is a number.
src/common/alphabet.rs:171
Function
a_shares_factor
()
src/affine.rs:147
Function
alphabet_encrypt
()
src/rot13.rs:56
Function
b_shares_factor
()
src/affine.rs:141
Function
bad_key
()
src/fractionated_morse.rs:294
Function
bigram_handles_odd_length
()
src/playfair.rs:299
Function
bigram_handles_repeats
()
src/playfair.rs:289
Method
calc_current_rail
For a given column and the total number of 'rails' (rows), determine the current rail that should be referenced.
src/railfence.rs:166
Method
calc_inverse_key
Calculates the inverse key for decryption
src/hill.rs:306
Function
check_playfair_positions
()
src/common/alphabet.rs:220
Function
check_playfair_retrieval
()
src/common/alphabet.rs:231
Function
concatonated_larger_base_key
()
src/common/keygen.rs:265
Function
concatonated_smaller_base_key
()
src/common/keygen.rs:270
Function
cyclic_larger_base_key
()
src/common/keygen.rs:260
Function
cyclic_smaller_base_key
()
src/common/keygen.rs:252
Method
decode_morse
Takes a sequence of trigraphs, which is then interpreted as morse code so that it may be converted back to plaintext.This function returns `Err` if an
src/fractionated_morse.rs:197
Function
decrypt
()
src/porta.rs:130
Method
decrypt
Decrypt a message using a Railfence cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Railfence}; let r = Railfence::new(3); assert_eq
src/railfence.rs:99
Method
decrypt
Decrypt a ciphertext with a Columnar Transposition cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, ColumnarTransposition}; let key_w
src/columnar_transposition.rs:146
Method
decrypt
Decrypt a message using a Polybius square cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Polybius}; let p = Polybius::new((String::
src/polybius.rs:119
Method
decrypt
Decrypt a message with the Playfair cipher. # Warning The 5x5 key table requires any 'J' characters in the message to be substituted with 'I' charact
src/playfair.rs:126
Method
decrypt
Decrypt a message using a Fractionated Morse cipher. The Fractionated Morse alphabet only contains the normal alphabetic characters `a-z`, therefore
src/fractionated_morse.rs:107
Method
decrypt
Decrypt a message that was encrypted with the Baconian cipher # Examples Basic usage: ``` use cipher_crypt::{Cipher, Baconian}; let b = Baconian::n
src/baconian.rs:271
Method
decrypt
Decrypt a message using a Scytale cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Scytale}; let ct = Scytale::new(6); assert_eq!("Pr
src/scytale.rs:97
Method
decrypt
Decrypt a message using a ADFGVX cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, ADFGVX}; let polybius_key = String::from("ph0qg64me
src/adfgvx.rs:116
Method
decrypt
Decrypt a message using an Affine cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Affine}; let a = Affine::new((3, 7)); assert_eq!("
src/affine.rs:78
Function
decrypt_a_classic
()
src/baconian.rs:384
Function
decrypt_bad_message
()
src/fractionated_morse.rs:306
Function
decrypt_long_key
()
src/railfence.rs:240
Function
decrypt_message
()
src/polybius.rs:173
Function
decrypt_message
()
src/caesar.rs:93
Function
decrypt_message
()
src/adfgvx.rs:169
Function
decrypt_message
()
src/affine.rs:105
Function
decrypt_mixed_case
()
src/railfence.rs:233
Function
decrypt_mixed_case
()
src/fractionated_morse.rs:259
Method
decrypt_morse
Takes ciphertext and converts it to a sequence of trigraph symbols. return `Err` if a non-alphabetic symbol is present in the message.
src/fractionated_morse.rs:178
Function
decrypt_short_key
()
src/railfence.rs:226
Function
decrypt_test
()
src/railfence.rs:219
Function
decrypt_test
()
src/fractionated_morse.rs:245
Function
decrypt_test
()
src/vigenere.rs:103
Function
decrypt_test
()
src/autokey.rs:137
Function
decrypt_traditional
()
src/baconian.rs:393
Function
decrypt_with_space_padding
()
src/adfgvx.rs:187
Function
decrypt_with_symbols
()
src/hill.rs:351
Method
encode_to_morse
Takes a message and converts it to Morse code, using the character `|` as a separator. The transposed sequence is ended with two separators `||`. This
src/fractionated_morse.rs:137
Function
encrypt
()
src/porta.rs:123
Method
encrypt
Encrypt a message using a Railfence cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Railfence}; let r = Railfence::new(3); assert_eq
src/railfence.rs:45
Method
encrypt
Encrypt a message using a Polybius square cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Polybius}; let p = Polybius::new((String::
src/polybius.rs:91
Method
encrypt
Encrypt a message with the Playfair cipher. # Warning The 5x5 key table requires any 'J' characters in the message to be substituted with 'I' charact
src/playfair.rs:84
Method
encrypt
Encrypt a message using a Fractionated Morse cipher. Morse code supports the characters `a-z`, `A-Z`, `0-9` and the special characters `@ ( ) . , : '
src/fractionated_morse.rs:61
Method
encrypt
Encrypt a message using a Scytale cipher. Whilst all characters (including utf8) can be encrypted during the transposition process, it is important t
src/scytale.rs:57
Method
encrypt
Encrypt a message using a ADFGVX cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, ADFGVX}; let polybius_key = String::from("ph0qg64me
src/adfgvx.rs:80
Method
encrypt
Encrypt a message using an Affine cipher. # Examples Basic usage: ``` use cipher_crypt::{Cipher, Affine}; let a = Affine::new((3, 7)); assert_eq!("
src/affine.rs:56
Function
encrypt_bad_message
()
src/fractionated_morse.rs:299
Function
encrypt_decoy_too_short
()
src/baconian.rs:351
Function
encrypt_long_key
()
src/railfence.rs:212
Function
encrypt_long_key
()
src/fractionated_morse.rs:279
Function
encrypt_message
()
src/polybius.rs:152
Function
encrypt_message
()
src/caesar.rs:87
Function
encrypt_message
()
src/affine.rs:99
Function
encrypt_message_spaced
()
src/baconian.rs:327
Function
encrypt_mixed_case
()
src/railfence.rs:198
next →
1–100 of 232, ranked by callers