mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-04-23 07:20:10 +00:00
securemail: update pgp library
Remove php-gpg, add openpgp-php and phpseclib. Add template file for settings. Add "send test" functionality. Add messages.po
This commit is contained in:
parent
02b2fe9b10
commit
50f91a338c
52 changed files with 35258 additions and 3205 deletions
31
securemail/vendor/singpolyma/openpgp-php/lib/openpgp_mcrypt_wrapper.php
vendored
Normal file
31
securemail/vendor/singpolyma/openpgp-php/lib/openpgp_mcrypt_wrapper.php
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
if(function_exists('mcrypt_encrypt') && defined('MCRYPT_MODE_CFB')) {
|
||||
class MCryptWrapper {
|
||||
public $cipher, $key, $iv, $key_size, $block_size;
|
||||
|
||||
|
||||
function __construct($cipher) {
|
||||
$this->cipher = $cipher;
|
||||
$this->key_size = mcrypt_module_get_algo_key_size($cipher);
|
||||
$this->block_size = mcrypt_module_get_algo_block_size($cipher);
|
||||
$this->iv = str_repeat("\0", mcrypt_get_iv_size($cipher, 'ncfb'));
|
||||
}
|
||||
|
||||
function setKey($key) {
|
||||
$this->key = $key;
|
||||
}
|
||||
|
||||
function setIV($iv) {
|
||||
$this->iv = $iv;
|
||||
}
|
||||
|
||||
function encrypt($data) {
|
||||
return mcrypt_encrypt($this->cipher, $this->key, $data, 'ncfb', $this->iv);
|
||||
}
|
||||
|
||||
function decrypt($data) {
|
||||
return mcrypt_decrypt($this->cipher, $this->key, $data, 'ncfb', $this->iv);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue