$this->msj_original = $mensaje;
        $c_Ori = strlen($this->msj_original);
        $c_Cla = count($this->clavePublica);
        for ($i = 0; $i < $c_Ori; $i++) {
            for ($j = 0; $j < $c_Cla; $j++) {
                if ($this->msj_original[$i] == $this->clavePublica[$j]) {
                    $this->msj_codificado[] = $this->clavePublica[$j];
                }
            }
        }
        echo "<br />  Codificado <br /> ";
        for ($i = 0; $i < $c_Ori; $i++) {
            echo $this->msj_codificado[$i];
        }
        echo "<br /> Original <br /> ";
        for ($i = 0; $i < $c_Ori; $i++) {
            echo $this->msj_original[$i];
        }
    }
    function Decodificar($mensaje)
    {
        $this->msj_codificado = $mensaje;
    }
}
//fin-class
$test = new Enigma(5);
$test->Codificar('jorge comia alfajores abajo de un arbol');
//
//GPG KeyID 80FEA850
//80FEA850 D3A8 D50C 17D8 91EC 0E0E AB16 67F7 E997 80FE A850
//sebastianarca@riseup.net
Beispiel #2
0
/**
 * This template intializes Enigma Frontend Engine.
 * @since IOA Framework V1
 * @version Enigma V2
 */
/**
 * Importing Required Files
 */
require_once HPATH . '/classes/ui.php';
require_once HPATH . '/rad_builder/class_radstyler.php';
require_once HPATH . '/deprecated/class_enigma.php';
require_once HPATH . '/deprecated/visual_settings.php';
/**
 * Initiating Objects
 */
$styler = new Enigma();
if (isset($_SESSION['rad_mode'])) {
    unset($_SESSION['rad_mode']);
}
/**
 * Exporting Alogrithm for Styles
 */
if (isset($_GET['export_en'])) {
    $id = $_GET['id'];
    $output = '';
    if ($id == 'default') {
        $table = get_option(SN . '_enigma_data');
        $name = 'default';
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename=' . basename($name . '.txt'));
        header('Expires: 0');