This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Practica 4.c Dencrypting: [Python 2.5.7rc1] | |
1.- Vamos a usar PyCrypto 2.6.1 (Last Version) | |
2.- Se pueden usar varias formas de generar RandomNumbers con PyCrypro ya que cuenta con una seccion | |
dedicada a ello: dlitz.net/software/pycrypto/api/2.6/Crypto.Random-module.html | |
3.- Para cifrar y descifrar usamos las funciones encrypt y decrypt dependiendo del cifrado y aqui se | |
puede ver toda la informacion de AES, asi como los modos de operacion: dlitz.net/software/pycrypto/api/2.6/ | |
4.- AES, ARC2, ARC4, Blowfish, CAST, DES, DES3, XOR, etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
char Alfabeto[62]; | |
int sizeK = 3, numLetras = 62; | |
int k[3][3]; | |
int kEstrella[3][3]; | |
string salida,cad; | |
int Algo1(int a, int b){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
map <char,char> Mi,Ci; | |
map <char,char>::iterator it; | |
int main(){ | |
string palabra,ended; | |
int u = 0, keyi = 65; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
//El tamaño de ArrAux se puede reducir al: Numero de factores primos de un numero Q. | |
int ArrAux[1000]; //Obvio Q seria el tamaño del alfabeto :v | |
int factP(int n){ | |
int Arri=0, aux=2; | |
//Tomamos los facotres primos de N | |
while(aux <= n){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package teest; | |
import java.util.*; | |
/* | |
NOTAS: | |
- Si se cambia la gramática tienen que modificarse los valores: numSimbNT, numSimbT, renglonesReglas y simbInicial [Constructor] | |
- Para contar los ST se considera ε | |
- Gramática sin rec x la izq o se buggea xD | |
- First recibe una cadena X y regresa una CADENA Y con los simbolos resultantes de First(X) | |
- Follow recibe una cadena X y regresa una CADENA Y con los simbolos resultantes de Follow(X) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "tiempo.h" | |
int Maxim(int * A, int n); | |
int Maximo(int * A, int ini, int fin, int max){ | |
return Maxim(A,fin); | |
int max_aux = 0; | |
if (ini == fin) max = A[ini]; | |
else{ | |
int mitad = (ini+fin)/2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "tiempo.h" | |
long long int TorresHanoi(int n, int ini, int med, int fin){ | |
static long long int movs = 0; | |
if(n == 1) movs++; //printf("Movimiento: %d -> %d\n",ini,fin); | |
else { | |
TorresHanoi(n-1, ini, fin, med); | |
//printf("Movimiento: %d -> %d\n",ini,fin); | |
movs++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include "tiempo.h" | |
int maxim(int a, int b){ | |
if(a<b) return b; | |
else return a; | |
} | |
long long int Power(int x, int y) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include "tiempo.h" | |
void merge(int arr[], int l, int m, int r){ | |
int i, j, k; | |
int n1 = m - l + 1; | |
int n2 = r - m; | |
int L[n1], R[n2]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include "tiempo.h" | |
void quickSort(int A[],int p,int r){ | |
int izq,der,temp,piv; | |
izq = p; | |
der = r; | |
piv = A[(izq+der)/2]; |
NewerOlder