Recent Posts
C# | 2 sec ago
None | 12 sec ago
PHP | 43 sec ago
Java | 1 min ago
Java | 1 min ago
PHP | 1 min ago
Perl | 2 min ago
None | 2 min ago
PHP | 2 min ago
C++ | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Epitaph64 on the 15th of Jun 2009 11:07:51 PM
Download |
Raw |
Embed |
Report
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package encrypttext;
/**
*
* @author Walter
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main
(String[] args
) {
String inputString
= "So, I'm pretty bored now, how about you?";
byte encryptionArray[] = new byte[128];
for (int i = 0; i < 128; i++)
{
encryptionArray
[i
] = (byte) (Math.
random() * 7
);
}
for (int i = 0; i < inputString.length(); i++)
{
char x = inputString.charAt(i);
x ^= encryptionArray[i%128];
outputString += x;
}
System.
out.
println(outputString
);
for (int i = 0; i < outputString.length(); i++)
{
char x = outputString.charAt(i);
x ^= encryptionArray[i%128];
originalString += x;
}
System.
out.
println(originalString
);
for (int i = 0; i < 128; i++)
{
key += encryptionArray[i];
}
System.
out.
println("\n Your key is: " + key
);
}
}
Submit a correction or amendment below.
Make A New Post