Skip to content

ddokkaebi/Blowfish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Blowfish

Blowfish C++ implementation

image

  • Tested on OSX (32bit/64bit)
  • ECB mode only
  • The key length must be a multiple of 8bit

Usage

#include <iostream>
#include "blowfish.h"

int main(int argc, const char * argv[])
{
    unsigned char key[] = "The quick brown fox jumps over the lazy dog.";
    
    Blowfish blowfish;
    blowfish.SetKey(key, sizeof(key));
    
    // Input/Output length must be a multiple of the block length (64bit)
    unsigned char text[16] = "There's nothing";
    
    blowfish.Encrypt(text, text, sizeof(text));
    std::cout << text << std::endl;
    
    blowfish.Decrypt(text, text, sizeof(text));
    std::cout << text << std::endl;
    
    return 0;
}

About

Blowfish C++ implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published