MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / affine_decrypt

Function affine_decrypt

src/ciphers/affine_cipher.rs:201–225  ·  view source on GitHub ↗

Decrypts a message using the affine cipher. # Arguments `key` - The decryption key (same as encryption key) `message` - The ciphertext message to decrypt # Returns `Ok(String)` with the decrypted message, or `Err(String)` if keys are invalid # Example ``` use the_algorithms_rust::ciphers::affine_decrypt; let decrypted = affine_decrypt(4545, "VL}p MM{I}p~{HL}Gp{vp pFsH}pxMpyxIx JHL O}F{~pvuO

(key: usize, message: &str)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 8

test_encrypt_simpleFunction · 0.85
test_empty_stringFunction · 0.85
test_symbols_not_in_setFunction · 0.85
test_generate_keyFunction · 0.85
test_all_symbolsFunction · 0.85
test_long_messageFunction · 0.85

Calls 5

check_keysFunction · 0.85
find_mod_inverseFunction · 0.85
pushMethod · 0.80
lenMethod · 0.45
findMethod · 0.45

Tested by 8

test_encrypt_simpleFunction · 0.68
test_empty_stringFunction · 0.68
test_symbols_not_in_setFunction · 0.68
test_generate_keyFunction · 0.68
test_all_symbolsFunction · 0.68
test_long_messageFunction · 0.68