-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmcript.php
More file actions
19 lines (18 loc) · 717 Bytes
/
mcript.php
File metadata and controls
19 lines (18 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
$clave = 'Somos el equipo raites, dicis,, sistemas computacionales, ingenieria de software, piriwiris';
$method = 'aes-256-cbc';
$iv = base64_decode("uO3Jb3hgCNp8V7ykUuRlAQ==");
$encriptar = function ($valor) use ($method, $clave, $iv) {
return openssl_encrypt ($valor, $method, $clave, false, $iv);
};
$desencriptar = function ($valor) use ($method, $clave, $iv) {
$encrypted_data = base64_decode($valor);
return openssl_decrypt($valor, $method, $clave, false, $iv);
};
/*
Genera un valor para IV
*/
$getIV = function () use ($method) {
return base64_encode(openssl_random_pseudo_bytes(openssl_cipher_iv_length($method)));
};
?>