Page 1 of 1

Implementation of a blowfish class?

Posted: Sat Jan 08, 2005 5:26 am
by PhantomCircuit
I found a class that encrypts and decrypts in blowfish and I wanted to know how to implement it in encrypting log files on my server (which are confidential by law in my county, yes my county (just slightly bigger than a city) has its own internet laws :roll: ).

The class can be found here

Thanks,
PhantomCircuit

Posted: Sat Jan 08, 2005 8:47 am
by feyd
call encryptBlock() with the data and key you wish to use (if you haven't previously set one)

use [php_man]file_get_contents()[/php_man] to load all of a log file into memory (provided memory allows)

Posted: Sat Jan 08, 2005 3:23 pm
by PhantomCircuit
Would that work?

Code: Select all

<?php 

include "class.inc";

$crypt=new Horde_Cipher_blowfish();
$key="big long key";
$text="cc#s";
$encrypted=$crypt->encryptBlock($text,$key);
$decrypted=$crypt->decryptBlock($encrypted,$key);
print $encrypted."<BR>".$decrypted;
?>

feyd | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Sat Jan 08, 2005 7:15 pm
by feyd
why not try it out?