Skip to content

Instantly share code, notes, and snippets.

@ulymarins
Created January 23, 2017 17:24
Show Gist options
  • Save ulymarins/8a928e78e64fae48463ac699b00385c6 to your computer and use it in GitHub Desktop.
Save ulymarins/8a928e78e64fae48463ac699b00385c6 to your computer and use it in GitHub Desktop.
Crypto 4all
public class App {
public static void main(String [] args) {
System.out.println("Chave 16bits: G3r0m3lcr1pt0666");
System.out.println("Vetor: RandomInitVector");
System.out.println("Iniciando criptografia");
String conteudoCriptografado = Crypto.encryptAES("tipoQr=4park&valorPassagem=250&id4all=2345");
System.out.println("Conteúdo criptografado: " + conteudoCriptografado);
System.out.println("Descriptografando...");
System.out.println("Conteudo descriptografado: " + Crypto.decryptAES(conteudoCriptografado));
}
/* Output
Chave 16bits: G3r0m3lcr1pt0666
Vetor: RandomInitVector
Iniciando criptografia
Conteúdo criptografado: 0kYXE304L2lN2yVXbNCCAWqGiUPgvwlaQG2ooujkuRKSt52zYG0X7lIMepeFFO57
Descriptografando...
Conteudo descriptografado: tipoQr=4park&valorPassagem=250&id4all=2345
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment