Posted: Tue Oct 20, 2009 10:35 pm Post subject: Java basic encryption question
Just had a question, made my own encryption(really,really simple) that scrambles the characters in a string of text based upon a numerical key.
It isn't anything fancy, but I was just wondering how would this be reverse engineered without a key.
Code:
import java.util.Scanner;
public class encrypt
{
public static void main(String[]args)
{
Scanner keyb = new Scanner(System.in);
String input = keyb.nextLine();
int key = keyb.nextInt();
Well, as long as you know where one letter should be in the plaintext and where it ended up after encryption, you can deduce the key. An easy example is maybe encrypting an url, you know that likely it will contain only one ':' character, 5 characters into the plaintext (ex. "http://"). You can figure out what modulus was used to get it transposed by analyzing the encrypted text, and subsequently decrypt the rest of the url.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum