| Welcome to Crypto. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
- Pages:
- 1
- 2
| Transposition Cipher Cracker (c++) | |
|---|---|
| Topic Started: Dec 17 2007, 08:42 PM (2,014 Views) | |
| Revelation | Dec 17 2007, 08:42 PM Post #1 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Well, I wrote a small platform independent transposition cipher cracker. Tested in Linux and in Windows. Ciphers with a key length under 11 are cracked within 10 seconds if you give a decent crib. If you find some optimizations, please mention them! I'd love to make this cracker faster. |
|
RRRREJMEEEEEPVKLWENFNVJKEEEEEAOLKAFKLXCFZAASDJXZTTTTTTTLSIOWJXMOKLAFJNNKFNXN RAGRBAQEMHIGDJVDSEOXVIYCELFHWLELJFIENXLRATALSJFSLCYTKLASJDKMHGOVOKAJDNMNUITN RRRRLJVEEEEECLYVYHNVPFTAEEEEEMWLMEIRNGLARWJAKJDFLWNTIERJMIPQWOTZEOCXKNUBNXCN RJIRPOWEANFUSNCZVDVZNMSFEKLOEPZLDKDJWSAAAAAAAOERHJCTNCKFRIMVKSOFOMKMANREWNBN RZUDRGXEEEEENFQIDVLQNCKNEEEEEDGLLLLLLAWIOSNCDARLODMTOEJXMILDFJROTKJSDNLVCZNN | |
![]() |
|
| jdege | Dec 17 2007, 09:08 PM Post #2 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
What kind of transposition? |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Revelation | Dec 17 2007, 09:39 PM Post #3 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
A columnar, with support for incomplete rows. |
|
RRRREJMEEEEEPVKLWENFNVJKEEEEEAOLKAFKLXCFZAASDJXZTTTTTTTLSIOWJXMOKLAFJNNKFNXN RAGRBAQEMHIGDJVDSEOXVIYCELFHWLELJFIENXLRATALSJFSLCYTKLASJDKMHGOVOKAJDNMNUITN RRRRLJVEEEEECLYVYHNVPFTAEEEEEMWLMEIRNGLARWJAKJDFLWNTIERJMIPQWOTZEOCXKNUBNXCN RJIRPOWEANFUSNCZVDVZNMSFEKLOEPZLDKDJWSAAAAAAAOERHJCTNCKFRIMVKSOFOMKMANREWNBN RZUDRGXEEEEENFQIDVLQNCKNEEEEEDGLLLLLLAWIOSNCDARLODMTOEJXMILDFJROTKJSDNLVCZNN | |
![]() |
|
| jdege | Dec 17 2007, 11:13 PM Post #4 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Am I misreading this, or is it brute-forcing the permutations? |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Revelation | Dec 18 2007, 08:51 AM Post #5 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You've read it correctly. Brute forcing is very fast though
|
|
RRRREJMEEEEEPVKLWENFNVJKEEEEEAOLKAFKLXCFZAASDJXZTTTTTTTLSIOWJXMOKLAFJNNKFNXN RAGRBAQEMHIGDJVDSEOXVIYCELFHWLELJFIENXLRATALSJFSLCYTKLASJDKMHGOVOKAJDNMNUITN RRRRLJVEEEEECLYVYHNVPFTAEEEEEMWLMEIRNGLARWJAKJDFLWNTIERJMIPQWOTZEOCXKNUBNXCN RJIRPOWEANFUSNCZVDVZNMSFEKLOEPZLDKDJWSAAAAAAAOERHJCTNCKFRIMVKSOFOMKMANREWNBN RZUDRGXEEEEENFQIDVLQNCKNEEEEEDGLLLLLLAWIOSNCDARLODMTOEJXMILDFJROTKJSDNLVCZNN | |
![]() |
|
| jdege | Dec 18 2007, 02:17 PM Post #6 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
So, is your next attempt going to try double transposition? |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Revelation | Dec 18 2007, 09:27 PM Post #7 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
It is
Maybe even the ADFVX cipher, but that is a hard to brute force, so then I need a way of filtering out only the plausible combinations. |
|
RRRREJMEEEEEPVKLWENFNVJKEEEEEAOLKAFKLXCFZAASDJXZTTTTTTTLSIOWJXMOKLAFJNNKFNXN RAGRBAQEMHIGDJVDSEOXVIYCELFHWLELJFIENXLRATALSJFSLCYTKLASJDKMHGOVOKAJDNMNUITN RRRRLJVEEEEECLYVYHNVPFTAEEEEEMWLMEIRNGLARWJAKJDFLWNTIERJMIPQWOTZEOCXKNUBNXCN RJIRPOWEANFUSNCZVDVZNMSFEKLOEPZLDKDJWSAAAAAAAOERHJCTNCKFRIMVKSOFOMKMANREWNBN RZUDRGXEEEEENFQIDVLQNCKNEEEEEDGLLLLLLAWIOSNCDARLODMTOEJXMILDFJROTKJSDNLVCZNN | |
![]() |
|
| jdege | Dec 18 2007, 09:53 PM Post #8 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Every issue of The Cryptogram advertises a number of publications. Among my recent purchases is GUNG HO's "Manual For Cryptanalysis of the Columnar Double Transposition Cipher". Apparently, it was pretty common to use the same keyword for both transpositions, which made things some easier. But the technique relied upon having enough traffic that there were several messages of identical length using the same key - at which point anagramming the messages simultaneously would pretty quickly reveal the plaintext. Single keyword, multiple keywords, interrupted columns, none of it matters at this point. The tricky part was to recover the keywords, so that you could read the rest of the traffic. That's where the difference between a one and two keywords would show up. |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Revelation | Jun 19 2009, 03:37 PM Post #9 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Someone contacted me recently, asking for the code of my cracker. Unfortunately, that was lost in action, so I wrote a new one. Although it could definitely use some improvement, it is pretty fast as it is now. I can tell you, it took me a while to come up with a good algorithm!
Edited by Revelation, Jun 19 2009, 03:37 PM.
|
|
RRRREJMEEEEEPVKLWENFNVJKEEEEEAOLKAFKLXCFZAASDJXZTTTTTTTLSIOWJXMOKLAFJNNKFNXN RAGRBAQEMHIGDJVDSEOXVIYCELFHWLELJFIENXLRATALSJFSLCYTKLASJDKMHGOVOKAJDNMNUITN RRRRLJVEEEEECLYVYHNVPFTAEEEEEMWLMEIRNGLARWJAKJDFLWNTIERJMIPQWOTZEOCXKNUBNXCN RJIRPOWEANFUSNCZVDVZNMSFEKLOEPZLDKDJWSAAAAAAAOERHJCTNCKFRIMVKSOFOMKMANREWNBN RZUDRGXEEEEENFQIDVLQNCKNEEEEEDGLLLLLLAWIOSNCDARLODMTOEJXMILDFJROTKJSDNLVCZNN | |
![]() |
|
| jdege | Jun 19 2009, 04:34 PM Post #10 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I've always found using pointer arithmetic that way to be confusing - easy to get wrong, and hard to tell when you had. There's no question, though, that it's hugely faster than reordering the characters. I find, when I do write code like this, I create about three times as much test code, to make sure I'm doing it right, than I do code to actually address the problem. I used to throw that test code away, when I was done, to leave something simple and clean like this. I no longer do so. I find that it can be very useful to keep it around, to make sure I don't break things the next time I need to make a "quick" modification. |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Revelation | Jun 20 2009, 09:35 AM Post #11 |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
It is, that's why I wrote down the algorithm, so I will never forget it.
It is very fast Keylengths below 11 take 3 seconds to be cracked. The hardcoded ciphertext with keylength 11 takes 40 seconds to be cracked.I think a great timesaver in my code is the d array, which counts the rest of irregular columnar transpositions depending on the current permutation. |
|
RRRREJMEEEEEPVKLWENFNVJKEEEEEAOLKAFKLXCFZAASDJXZTTTTTTTLSIOWJXMOKLAFJNNKFNXN RAGRBAQEMHIGDJVDSEOXVIYCELFHWLELJFIENXLRATALSJFSLCYTKLASJDKMHGOVOKAJDNMNUITN RRRRLJVEEEEECLYVYHNVPFTAEEEEEMWLMEIRNGLARWJAKJDFLWNTIERJMIPQWOTZEOCXKNUBNXCN RJIRPOWEANFUSNCZVDVZNMSFEKLOEPZLDKDJWSAAAAAAAOERHJCTNCKFRIMVKSOFOMKMANREWNBN RZUDRGXEEEEENFQIDVLQNCKNEEEEEDGLLLLLLAWIOSNCDARLODMTOEJXMILDFJROTKJSDNLVCZNN | |
![]() |
|
| jdege | Jun 23 2009, 12:18 AM Post #12 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Under three seconds - if the crib is present. Have you tried this using statistical tests? |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| osric | Jul 3 2009, 06:44 PM Post #13 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
How long does it take to solve a period 11 columnar without a crib? How long to solve a period 20 columnar without a crib? |
![]() |
|
| jdege | Jul 5 2009, 02:40 PM Post #14 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
The program he posted uses the crib to test for success. In the absence of a crib, it has no way to recognize that it has found a solution. It'd not be difficult to replace testing the trial decrypts against the crib with testing against the statistical properties of ordinary text, but I've not done it. And my guess is that the test would take longer, making the program slower. As for how long to solve a period 20 columnar? The answer is never. If it takes three seconds to crack a period 10 columnar, it'd take more than 7000 years to crack a period 20 columnar. You'd either need to throw some serious hardware at the problem, or choose a different approach. |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| osric | Jul 5 2009, 03:54 PM Post #15 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
My point is that solving a Columnar with a crib is so easy that it's not worth discussing, let alone posting solving programs. Solving without a crib poses something of a challenge. "Testing against the statistical properties" is a nice thought but requires too much ciphertext. "As for how long to solve a period 20 columnar? The answer is never." This is rubbish. With the correct algorithm it can be done in minutes. Think again. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · General · Next Topic » |
- Pages:
- 1
- 2





![]](http://209.85.122.85/static/1/pip_r.png)



col.cpp (2.57 KB)
6:50 PM Mar 21