Skip to content

pennaliu/Blowfish

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 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
  • PKCS #5 Padding

Usage

#include <iostream>
#include <string>

#include "blowfish.h"

int main(int argc, const char * argv[])
{
    char key[] = "The quick brown fox jumps over the lazy dog.";
    
    Blowfish blowfish;
    blowfish.SetKey(key);
    
    std::string text = "This is not a pipe.";
    std::string encrypted, decrypted;
    
    blowfish.Encrypt(&encrypted, text);
    std::cout << encrypted << std::endl;
    
    blowfish.Decrypt(&decrypted, encrypted);
    std::cout << decrypted << std::endl;
    
    return 0;
}

About

Blowfish C++ implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors