close
Warning:
Failed to sync with repository "ogBrowser-Git": (1366, "Incorrect string value: '\\xF0\\x9F\\x93\\xA6 I...' for column 'message' at row 1"); repository information may be out of date. Look in the Trac log for more information including mitigation strategies.
918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | /*================================================================================ |
|---|
| 3 | Clase para encriptar y desencriptar cadenas |
|---|
| 4 | ================================================================================*/ |
|---|
| 5 | class EncripDescrip{ |
|---|
| 6 | var $cadena; // La cadena encriptada o desencriptada que ser�devuelta |
|---|
| 7 | var $clave; // La clave de la cadena encriptada o desencriptada que ser�devuelta |
|---|
| 8 | //________________________________________________________________________________________ |
|---|
| 9 | // |
|---|
| 10 | // Constructor |
|---|
| 11 | //________________________________________________________________________________________ |
|---|
| 12 | function EncripDescrip($clave=12){ |
|---|
| 13 | $this->cadena=""; |
|---|
| 14 | $this->clave=$clave; |
|---|
| 15 | } |
|---|
| 16 | // ____________________________________________________________________________ |
|---|
| 17 | // |
|---|
| 18 | // Encripta una cadena |
|---|
| 19 | //_____________________________________________________________________________ |
|---|
| 20 | function Encriptar($cadena){ |
|---|
| 21 | |
|---|
| 22 | return( $cadena); |
|---|
| 23 | |
|---|
| 24 | $clave=(int)$this->clave; |
|---|
| 25 | $clave = (int)$clave & 0xFF; |
|---|
| 26 | $lon=strlen($cadena); |
|---|
| 27 | $this->cadena=""; |
|---|
| 28 | for($i=0;$i<$lon;$i++){ |
|---|
| 29 | $ch=(int)ord($cadena[$i]); |
|---|
| 30 | $pot=(int)$ch^(int)$clave; |
|---|
| 31 | $this->cadena.=chr($pot); |
|---|
| 32 | } |
|---|
| 33 | return( $this->cadena); |
|---|
| 34 | } |
|---|
| 35 | // ____________________________________________________________________________ |
|---|
| 36 | // |
|---|
| 37 | // Desencripta una cadena |
|---|
| 38 | //_____________________________________________________________________________ |
|---|
| 39 | function Desencriptar($cadena){ |
|---|
| 40 | |
|---|
| 41 | return( $cadena); |
|---|
| 42 | |
|---|
| 43 | $clave=(int)$this->clave; |
|---|
| 44 | $clave = (int)$clave & 0xFF; |
|---|
| 45 | $lon=strlen($cadena); |
|---|
| 46 | $this->cadena=""; |
|---|
| 47 | for($i=0;$i<$lon;$i++){ |
|---|
| 48 | $ch=(int)ord($cadena[$i]); |
|---|
| 49 | $pot=(int)$ch^(int)$clave; |
|---|
| 50 | $this->cadena.=chr($pot); |
|---|
| 51 | } |
|---|
| 52 | return( $this->cadena); |
|---|
| 53 | } |
|---|
| 54 | } |
|---|
| 55 | ?> |
|---|
Note: See
TracBrowser
for help on using the repository browser.