Program to decode scytale cypher
- From: Tobias Matzat <tobiasmatzat@xxxxxxxxxx>
- Date: Thu, 19 Oct 2006 21:45:57 +0200
Hi!
I wrote a simple java program to decode scytale ciphers (columnar transposition). Here is the code:
private String Decode(int len) {
StringBuffer buf = new StringBuffer();
for(int i = 0; i < len; i++) {
for(int j = 0; j < cipher.length(); j = j + len) {
char ch;
if(i+j < cipher.length()) {
ch = cipher.charAt((i + j));
buf.append(ch);
}
}
}
return buf.toString();
}
Well it works for example for "kerhe lxdit atzfe rwufx ticrt" (klartext
wird zu chiffretext)
Then I found this message:
"IMAZNNDCABMEUUÜHLEARNRNRNRNWEIBNEAIDMSIOSRNAISNCNCEHBEHNHNIAIEHCENNMAHIND-DTN"
But I can't decode it ?? Works the code correctly?
THX!
Tobias
.
- Prev by Date: Algorithm for quick Fermat test ?
- Next by Date: Re: Algorithm for quick Fermat test ?
- Previous by thread: Algorithm for quick Fermat test ?
- Next by thread: Re: New lightweight block cipher algorithm
- Index(es):
Relevant Pages
|