Completed
Push — master ( 4ddcf1...b67918 )
by Ramon
11:18
created

Util::pkcs5Pad()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Codecraft63\CertsignLogin;
4
5
trait Util
6
{
7
    private static function getCipher(): array
8
    {
9
        $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
10
        $iv_size = mcrypt_enc_get_iv_size($cipher);
11
        $key_size = mcrypt_enc_get_key_size($cipher);
12
13
        return [$cipher, $iv_size, $key_size];
14
    }
15
16
    private static function finalizeCipher($cipher)
17
    {
18
        mcrypt_generic_deinit($cipher);
19
        mcrypt_module_close($cipher);
20
    }
21
}
22