elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Perl] Ejemplo de Cifrado Murcielago
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Perl] Ejemplo de Cifrado Murcielago  (Leído 1,818 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl] Ejemplo de Cifrado Murcielago
« en: 21 Noviembre 2014, 14:11 pm »

Un simple ejemplo en Perl sobre como realizar el cifrado Murcielago.

Código
  1. # !usr/bin/perl
  2. # Cifrado Murcielago
  3. # Coded By Doddy Hackman in the year 2014
  4.  
  5. head();
  6. menu();
  7. copyright();
  8.  
  9. # Functions
  10.  
  11. sub head {
  12.    print "\n-- == Cifrado Murcielago == --\n";
  13. }
  14.  
  15. sub copyright {
  16.    print "\n\n-- == (C) Doddy Hackman 2014 == --\n";
  17. }
  18.  
  19. sub menu {
  20.    print qq(
  21. ===============
  22. = Menu        =
  23. ===============
  24. 1 - Cifrar    =
  25. 2 - Descifrar =
  26. 3 - Exit      =
  27. ===============
  28. );
  29.  
  30.    print "\n[+] Option : ";
  31.    chomp( my $op = <stdin> );
  32.  
  33.    if ( $op eq "3" ) {
  34.        copyright();
  35.        <stdin>;
  36.        exit(1);
  37.    }
  38.  
  39.    print "\n[+] Enter text : ";
  40.    chomp( my $text = <stdin> );
  41.  
  42.    print "\n[+] Result ...\n\n";
  43.  
  44.    if ( $op eq "1" ) {
  45.        print cifrado_murcielago($text);
  46.        <stdin>;
  47.        menu();
  48.    }
  49.    elsif ( $op eq "2" ) {
  50.        print descifrado_murcielago($text);
  51.        <stdin>;
  52.        menu();
  53.    }
  54.    else {
  55.        menu();
  56.    }
  57.  
  58. }
  59.  
  60. sub cifrado_murcielago {
  61.    my $texto = shift;
  62.    $texto =~ tr/murcielagoMURCIELAGO/01234567890123456789/;
  63.    return $texto;
  64. }
  65.  
  66. sub descifrado_murcielago {
  67.    my $texto = shift;
  68.    $texto =~ tr/01234567890123456789/murcielagoMURCIELAGO/;
  69.    return $texto;
  70. }
  71.  
  72. # The End ?
  73.  


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Duda con un ejemplo simple en Perl
Scripting
skan 3 2,841 Último mensaje 19 Mayo 2010, 13:08 pm
por skan
Los programadores y sus genes de murciélago « 1 2 »
Noticias
wolfbcn 13 5,861 Último mensaje 27 Enero 2013, 13:34 pm
por ‭‭‭‭jackl007
[Perl] Ejemplo de Cifrado Cesar
Scripting
BigBear 0 1,971 Último mensaje 28 Noviembre 2014, 17:48 pm
por BigBear
[Perl] Ejemplo de Sucesion Fibonacci
Scripting
BigBear 0 2,451 Último mensaje 5 Diciembre 2014, 15:04 pm
por BigBear
[Perl] Ejemplo de Cifrado Vigenere
Scripting
BigBear 0 1,998 Último mensaje 13 Diciembre 2014, 15:23 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines