summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/clases/EncripDescrip.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/WebConsole/clases/EncripDescrip.php')
-rw-r--r--admin/WebConsole/clases/EncripDescrip.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/admin/WebConsole/clases/EncripDescrip.php b/admin/WebConsole/clases/EncripDescrip.php
new file mode 100644
index 00000000..893bf48f
--- /dev/null
+++ b/admin/WebConsole/clases/EncripDescrip.php
@@ -0,0 +1,56 @@
+<?php
+
+/*================================================================================
+ Clase para encriptar y desencriptar cadenas cadenas
+================================================================================*/
+class EncripDescrip{
+ var $cadena; // La cadena encriptada o desencriptada que ser�devuelta
+ var $clave; // La clave de la cadena encriptada o desencriptada que ser�devuelta
+ //________________________________________________________________________________________
+ //
+ // Constructor
+ //________________________________________________________________________________________
+ function EncripDescrip($clave=12){
+ $this->cadena="";
+ $this->clave=$clave;
+ }
+ // ____________________________________________________________________________
+ //
+ // Encripta una cadena
+ //_____________________________________________________________________________
+ function Encriptar($cadena){
+
+ return( $cadena);
+
+ $clave=(int)$this->clave;
+ $clave = (int)$clave & 0xFF;
+ $lon=strlen($cadena);
+ $this->cadena="";
+ for($i=0;$i<$lon;$i++){
+ $ch=(int)ord($cadena[$i]);
+ $pot=(int)$ch^(int)$clave;
+ $this->cadena.=chr($pot);
+ }
+ return( $this->cadena);
+ }
+ // ____________________________________________________________________________
+ //
+ // Desencripta una cadena
+ //_____________________________________________________________________________
+ function Desencriptar($cadena){
+
+ return( $cadena);
+
+ $clave=(int)$this->clave;
+ $clave = (int)$clave & 0xFF;
+ $lon=strlen($cadena);
+ $this->cadena="";
+ for($i=0;$i<$lon;$i++){
+ $ch=(int)ord($cadena[$i]);
+ $pot=(int)$ch^(int)$clave;
+ $this->cadena.=chr($pot);
+ }
+ return( $this->cadena);
+ }
+}
+?> \ No newline at end of file