Skip to content

Instantly share code, notes, and snippets.

@treffynnon
Created February 4, 2010 15:19
Show Gist options
  • Save treffynnon/294724 to your computer and use it in GitHub Desktop.
Save treffynnon/294724 to your computer and use it in GitHub Desktop.
Wrapper for handling SHA1 encrypted sessions in ADODB
<?php
if (!defined('ADODB_SESSION')) die();
include_once ADODB_SESSION . '/crypt.inc.php';
class ADODB_Encrypt_SHA1 {
function write($data, $key) {
$sha1crypt =& new SHA1Crypt();
return $sha1crypt->encrypt($data, $key);
}
function read($data, $key) {
$sha1crypt =& new SHA1Crypt();
return $sha1crypt->decrypt($data, $key);
}
}
return 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment