Rename symmetric encrypt/decrypt class
I'm going to make this one more generic than one library, and have it support ciphers based on what libraries are available, so this more generic name is appropriate.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
require 'Crypt/RSA.php';
|
||||
|
||||
require_once dirname(__FILE__).'/openpgp.php';
|
||||
@include_once dirname(__FILE__).'/openpgp_cryph_aes_tripledes.php'; /* For encrypt/decrypt */
|
||||
@include_once dirname(__FILE__).'/openpgp_crypt_symmetric.php'; /* For encrypt/decrypt */
|
||||
|
||||
class OpenPGP_Crypt_RSA {
|
||||
protected $key, $message;
|
||||
@@ -194,7 +194,7 @@ class OpenPGP_Crypt_RSA {
|
||||
|
||||
if(!$sk) continue;
|
||||
|
||||
$r = OpenPGP_Crypt_AES_TripleDES::decryptPacket(OpenPGP_Crypt_AES_TripleDES::getEncryptedData($message), $sk[0], $sk[1]);
|
||||
$r = OpenPGP_Crypt_Symmetric::decryptPacket(OpenPGP_Crypt_Symmetric::getEncryptedData($message), $sk[0], $sk[1]);
|
||||
if($r) return $r;
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ require_once 'Crypt/AES.php';
|
||||
require_once 'Crypt/TripleDES.php';
|
||||
require_once 'Crypt/Random.php';
|
||||
|
||||
class OpenPGP_Crypt_AES_TripleDES {
|
||||
class OpenPGP_Crypt_Symmetric {
|
||||
public static function encrypt($passphrases_and_keys, $message, $symmetric_algorithm=9) {
|
||||
list($cipher, $key_bytes, $key_block_bytes) = self::getCipher($symmetric_algorithm);
|
||||
if(!$cipher) throw new Exception("Only AES/3DES are supported.");
|
Reference in New Issue
Block a user