Thread: Blowfish Encryption

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    1

    Blowfish Encryption

    Hi there,

    I found some code here for blowfish encryption algorithm:
    http://www.counterpane.com/blowfish.html

    The C encrypt function looks like this:

    Code:
    Blowfish_encipher(unsigned long *xl, unsigned long *xr){ 
    etc...}
    Has anyone seen this and can help me with understanding what i need to put in to those two parameters because I'm trying to encrypt an entire file.

    Thanx

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    143
    There is a paper on the site that you reference which tells you how the algorithm works. I suggest you read it.

    The input into the algorithm is a 64-bit word, x. you split this into two 32-bit words xl (x-left) and xr (x-right), I guess how you do this is up to you but the obvious way is make xl the most significant 32 bits of x and xr the least significant. It doesn't really matter that much as long as the sender and receiver do it the same way!

    Then just pass pointers to xl and xr into the function (look at the examples in the code). To encrypt/decrypt a file just pass the data in one 64-bit word at a time.
    DavT
    -----------------------------------------------

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  2. help needed with edit control & encryption
    By willc0de4food in forum Windows Programming
    Replies: 2
    Last Post: 03-16-2006, 08:21 PM
  3. abt encryption algorithm
    By purIn in forum C Programming
    Replies: 9
    Last Post: 12-22-2003, 10:16 PM
  4. relative strength of encryption algorithms (blowfish, des, rinjdael...)
    By duck-billed platypus in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 12-30-2001, 04:20 PM
  5. File Encryption & Read/Write in Binary Mode
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 11-30-2001, 06:45 PM