-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEncryptar.class.php
More file actions
51 lines (42 loc) · 886 Bytes
/
Encryptar.class.php
File metadata and controls
51 lines (42 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
class Contenido
{
protected $id;
protected $texto;
public function __construct()
{
}
public function getContenido()
{
return $this->contenido;
}
public function setContenido($contenido)
{
$this->contenido = $contenido;
}
public function encriptar($data, $key = "key")
{
$opensslentrypt = openssl_encrypt($data, "aes-256-ofb", $key);
return $opensslentrypt;
}
public function comprimir($data)
{
}
}
$cont = new Contenido();
$encriptado = $cont->encriptar("MiPass", "keypass");
echo "<pre>";
var_dump($encriptado);
echo "</pre>";
/*
$time = date("G:i:s");
$entry = "Información guardada a las $time.\n";
$file = "/var/www/html/clarin/test.cron.txt";
$open = fopen($file,"a");
if($open){
fwrite($open,$entry);
fclose($open);
}else{
die("error");
}
*/