A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/dc/dfb/atbash__cipher_8cpp_source.html below:

TheAlgorithms/C++: ciphers/atbash_cipher.cpp Source File

Go to the documentation of this file. 29

std::map<char, char> atbash_cipher_map = {

30

{

'a'

,

'z'

}, {

'b'

,

'y'

}, {

'c'

,

'x'

}, {

'd'

,

'w'

}, {

'e'

,

'v'

}, {

'f'

,

'u'

},

31

{

'g'

,

't'

}, {

'h'

,

's'

}, {

'i'

,

'r'

}, {

'j'

,

'q'

}, {

'k'

,

'p'

}, {

'l'

,

'o'

},

32

{

'm'

,

'n'

}, {

'n'

,

'm'

}, {

'o'

,

'l'

}, {

'p'

,

'k'

}, {

'q'

,

'j'

}, {

'r'

,

'i'

},

33

{

's'

,

'h'

}, {

't'

,

'g'

}, {

'u'

,

'f'

}, {

'v'

,

'e'

}, {

'w'

,

'd'

}, {

'x'

,

'c'

},

34

{

'y'

,

'b'

}, {

'z'

,

'a'

}, {

'A'

,

'Z'

}, {

'B'

,

'Y'

}, {

'C'

,

'X'

}, {

'D'

,

'W'

},

35

{

'E'

,

'V'

}, {

'F'

,

'U'

}, {

'G'

,

'T'

}, {

'H'

,

'S'

}, {

'I'

,

'R'

}, {

'J'

,

'Q'

},

36

{

'K'

,

'P'

}, {

'L'

,

'O'

}, {

'M'

,

'N'

}, {

'N'

,

'M'

}, {

'O'

,

'L'

}, {

'P'

,

'K'

},

37

{

'Q'

,

'J'

}, {

'R'

,

'I'

}, {

'S'

,

'H'

}, {

'T'

,

'G'

}, {

'U'

,

'F'

}, {

'V'

,

'E'

},

38

{

'W'

,

'D'

}, {

'X'

,

'C'

}, {

'Y'

,

'B'

}, {

'Z'

,

'A'

}, {

' '

,

' '

}

49 for

(

char

letter : text) {

50

result += atbash_cipher_map[letter];

64

std::string text =

"Hello World"

;

65

std::string expected =

"Svool Dliow"

;

68

assert(expected == encrypted_text);

69

assert(text == decrypted_text);

70

std::cout <<

"Original text: "

<< text << std::endl;

71

std::cout <<

", Expected text: "

<< expected << std::endl;

72

std::cout <<

", Encrypted text: "

<< encrypted_text << std::endl;

73

std::cout <<

", Decrypted text: "

<< decrypted_text << std::endl;

74

std::cout <<

"\nAll tests have successfully passed!\n"

;

std::string atbash_cipher(const std::string &text)

atbash cipher encryption and decryption

static void test()

Self-test implementations.

int main()

Main function.

Functions for the Atbash Cipher implementation.

Algorithms for encryption and decryption.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4