ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
1154
1154
EMPFEHLEN
-
19.10.08 19:32 #1
- Registriert seit
- Oct 2008
- Beiträge
- 1
Hallo, vielleicht kann mir hier ja jemand helfen, hab ein Java Programm wo am Ende folgender verschlüsselter Text bei rauskommt:
Hex: 2219b1041244c6e25203e40101d4cfda8c0ddded1af89946f7047693812cab8c5a3f4cf422d131f2d939ca83433c1215c6c5 ad7a
Das Java Programm soll eine Schwachstelle haben um den Text leicht zu entschlüsseln:
class StreamCipher1 {
private byte S[] = new byte[256];
private int ii = 0, jj = 0;
public void keysetup(byte[] key)
{
for (int i = 0; i < 256; i++)
{
S[i] = (byte) i;
}
int i = 0;
byte c;
for (int j = 0; j < 256; j++)
{
i = (j + key[i % 3]) % 8;
c = S[i];
S[i] = S[j];
S[j] = c;
}
}
public byte encrypt(byte c)
{
ii = (ii + 1) % 256;
jj = (jj + S[ii]) % 256;
if (jj < 0)
{
jj += 256;
}
byte h = S[ii];
S[ii] = S[jj];
S[jj] = h;
return (byte) (S[ii] ^ c);
}
public static void main(String[] argv)
{
byte[] key = new byte[8];
byte[] message = new String("");
// initialisation of key and plaintext removed
byte c;
StreamCipher1 s = new StreamCipher1();
s.keysetup(key);
for (int i = 0; i < message.length; i++)
{
c = s.encrypt(message[i]);
System.out.print(Integer.toHexString(c + 128));
}
// resulting ciphertext is 2219b1041244c6e25203e40101d4cfda8c0ddded1af89946f7047693812cab8c5a3f4cf422d131f2d939ca83433c1215c6c5 ad7a
}
}
Wäre Super wenn hier jemand die Schwachstelle sieht/findet.
Gruß, AyCaramba
Ähnliche Themen
-
Text in Live-Stream einfügen. Realtime overlay...
Von roxxx im Forum Videoschnitt, Videotechnik & -produktionAntworten: 2Letzter Beitrag: 05.11.10, 19:48 -
[C++/WinApi] Text-Stream anzeigen -> wie?
Von posi90 im Forum C/C++Antworten: 6Letzter Beitrag: 03.09.10, 07:19 -
cipher funtkioniert nicht so wie ich das will
Von jer1cho im Forum JavaAntworten: 2Letzter Beitrag: 13.08.07, 08:57 -
Cipher Algorithmen
Von zerix im Forum JavaAntworten: 2Letzter Beitrag: 25.10.05, 22:11 -
cipher strengh beim IE
Von mr_d2254 im Forum Microsoft WindowsAntworten: 6Letzter Beitrag: 17.04.03, 11:42





Zitieren
Login





