Data Structures & Algorithms in C++
Goodrich, Tamassia, Mount and Goldwasser
Loading...
Searching...
No Matches
Public Member Functions
dsac::array::CaesarCipher Class Reference

Class for doing encryption and decryption using the Caesar Cipher. More...

#include <caesar_cipher.h>

Collaboration diagram for dsac::array::CaesarCipher:
Collaboration graph

Public Member Functions

 CaesarCipher (int rotation=1)
 
std::string encrypt (const std::string &message)
 
std::string decrypt (const std::string &secret)
 

Detailed Description

Class for doing encryption and decryption using the Caesar Cipher.

Constructor & Destructor Documentation

◆ CaesarCipher()

dsac::array::CaesarCipher::CaesarCipher ( int  rotation = 1)
inline

Constructor that initializes the encryption and decryption strings

Parameters
rotationthe amount of forward shift (default: 1)

Member Function Documentation

◆ decrypt()

std::string dsac::array::CaesarCipher::decrypt ( const std::string &  secret)
inline

Returns a decrypted message, given the encrypted secret.

Parameters
secretthe encrypted message
Returns
the original (unencrypted) message

◆ encrypt()

std::string dsac::array::CaesarCipher::encrypt ( const std::string &  message)
inline

Returns an encrypted version of an original message.

Parameters
messagethe original message
Returns
the encrypted message

The documentation for this class was generated from the following file: