MD5 block cipher. Stands as a foundation for MD5 hashes. More...

#include <md5.hpp>

+ Collaboration diagram for nil::crypto3::block::md5:

Classes

struct  stream_processor
 

Public Types

typedef policy_type::block_type block_type
 
typedef stream_endian::little_octet_big_bit endian_type
 
typedef policy_type::key_type key_type
 
typedef policy_type::word_type word_type
 

Public Member Functions

block_type decrypt (const block_type &ciphertext) const
 
block_type encrypt (const block_type &plaintext) const
 
 md5 (const key_type &k)
 
virtual ~md5 ()
 

Static Public Attributes

constexpr static const std::size_t block_bits = policy_type::block_bits
 
constexpr static const std::size_t block_words = policy_type::block_words
 
constexpr static const std::size_t key_bits = policy_type::key_bits
 
constexpr static const std::size_t key_words = policy_type::key_words
 
constexpr static const std::size_t rounds = policy_type::rounds
 
constexpr static const std::size_t word_bits = policy_type::word_bits
 

Static Protected Member Functions

static block_type decrypt_block (key_type const &key, const block_type &ciphertext)
 
static block_type encrypt_block (key_type const &key, block_type const &plaintext)
 

Protected Attributes

key_type key
 

Detailed Description

MD5 block cipher. Stands as a foundation for MD5 hashes.

Encrypt implemented directly from the RFC as found at http://www.faqs.org/rfcs/rfc1321.html

Decrypt is a straight-forward inverse

In MD5 terminology:

  • plaintext = AA, BB, CC, and DD
  • ciphertext = A, B, C, and D
  • key = M^(i) and X

Member Typedef Documentation

◆ block_type

◆ endian_type

◆ key_type

◆ word_type

Constructor & Destructor Documentation

◆ md5()

nil::crypto3::block::md5::md5 ( const key_type k)
inline

◆ ~md5()

virtual nil::crypto3::block::md5::~md5 ( )
inlinevirtual

Member Function Documentation

◆ decrypt()

block_type nil::crypto3::block::md5::decrypt ( const block_type ciphertext) const
inline

◆ decrypt_block()

static block_type nil::crypto3::block::md5::decrypt_block ( key_type const &  key,
const block_type ciphertext 
)
inlinestaticprotected

◆ encrypt()

block_type nil::crypto3::block::md5::encrypt ( const block_type plaintext) const
inline

◆ encrypt_block()

static block_type nil::crypto3::block::md5::encrypt_block ( key_type const &  key,
block_type const &  plaintext 
)
inlinestaticprotected

Member Data Documentation

◆ block_bits

constexpr static const std::size_t nil::crypto3::block::md5::block_bits = policy_type::block_bits
staticconstexpr

◆ block_words

constexpr static const std::size_t nil::crypto3::block::md5::block_words = policy_type::block_words
staticconstexpr

◆ key

key_type nil::crypto3::block::md5::key
protected

◆ key_bits

constexpr static const std::size_t nil::crypto3::block::md5::key_bits = policy_type::key_bits
staticconstexpr

◆ key_words

constexpr static const std::size_t nil::crypto3::block::md5::key_words = policy_type::key_words
staticconstexpr

◆ rounds

constexpr static const std::size_t nil::crypto3::block::md5::rounds = policy_type::rounds
staticconstexpr

◆ word_bits

constexpr static const std::size_t nil::crypto3::block::md5::word_bits = policy_type::word_bits
staticconstexpr

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