Skip to content

Instantly share code, notes, and snippets.

@johobemax
Created July 2, 2010 05:31
Show Gist options
  • Save johobemax/460974 to your computer and use it in GitHub Desktop.
Save johobemax/460974 to your computer and use it in GitHub Desktop.
public class Enc
{
public static void main(String[] args)
{
int data = Integer.parseInt(args[0]);
int key1 = Integer.parseInt(args[1]);
int key2 = Integer.parseInt(args[2]);
int enc = data ^ key1;
System.out.println("encode=>"+enc);
int dec = enc ^ key2;
System.out.println("decode=>"+dec);
}
}
@johobemax
Copy link
Author

XORを使った暗号化のサンプルプログラム。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment