Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Encryption Security Programming IT Technology

Colossus Cipher Challenge Winner On Ada 168

An anonymous reader writes "Colossus Cipher Challenge winner Joachim Schueth talks about why he settled on Ada as his language of choice to unravel a code transmitted from the Heinz Nixdorf Museum in Germany, from a Lorenz SZ42 Cipher machine (used by the German High Command to relay secret messages during the World War II). 'Ada allowed me to concisely express the algorithms I wanted to implement.'"
This discussion has been archived. No new comments can be posted.

Colossus Cipher Challenge Winner On Ada

Comments Filter:
  • by Ober ( 12002 ) on Thursday May 15, 2008 @10:19AM (#23417664)
    Really good interview found here.
    http://www.netbsd.org/gallery/schueth-interview.html [netbsd.org]
  • Re:Type Casting (Score:3, Informative)

    by Zoxed ( 676559 ) on Thursday May 15, 2008 @10:24AM (#23417730) Homepage
    > It doesn't allow for type conversion

    It does (unchecked_conversion), but never (AFAIK) *implicitly*.
  • Re:Wimp using ASCII (Score:2, Informative)

    by 91degrees ( 207121 ) on Thursday May 15, 2008 @10:28AM (#23417780) Journal
    But you're using an ASCII representation of a binary representation of an ASCII string!

    You're using ASCII twice so you're twice the wimp!
  • by puddles ( 147314 ) on Thursday May 15, 2008 @10:32AM (#23417824)
    http://www.schlaupelz.de/SZ42/SZ42_software.html
  • Another interview (Score:1, Informative)

    by egilhh ( 689523 ) on Thursday May 15, 2008 @10:45AM (#23417988)
    There's another interview with him at adacore.com (makers of the GNAT compiler)

    http://www.adacore.com/home/ada_answers/lorenz-code/ [adacore.com]
  • by glop ( 181086 ) on Thursday May 15, 2008 @11:13AM (#23418320)
    Hi,

    The GNAT is based on GCC. It's free and it is damn good.
    I was also using AONIX and they have a free (as in beer) version. I have always preferred GNAT though.

    I am not sure about a website though...

  • by DdJ ( 10790 ) on Thursday May 15, 2008 @11:16AM (#23418358) Homepage Journal
    Can't give you advice on the PC, but on the Mac, the default compiler is the GNU compiler suite. That's where the C, C++, and Objective-C compilers come from.

    The GNU compiler suite also has an ADA compiler (GNAT, GNU Ada Translator). Should be possible to get it and plug it in without much trouble, and then it'd integrate with everything else. Heck, should be possible to include ADA modules into an Objective-C Cocoa application, even.

    There is also a GNU FORTRAN, worth checking out. Even today, you can't do mathematics as efficiently in C as you can in FORTRAN. (This is because of the language; in Fortran, taking the address of an existing variable isn't normal, so variables don't end up with the possibility of "aliases" that they don't know about, which means a lot more stuff can safely be done all in registers and stuff like that.)

    There is also a GNU Pascal, but unlike ADA and FORTRAN, I'm not personally aware of any reason to actually use it.
  • by jellomizer ( 103300 ) on Thursday May 15, 2008 @11:18AM (#23418380)
    Well it is more complex then that. Different language syntax can help or hinder someones performance for a particular job. For example old C didn't have much to say in terms of string handling if you wanted to use a string you needed to do a Char *VarName then when working with that languge you need to insure memory managment and that you don't create buffer overflows..... A big pain if you didn't make youself some good String functions you spend a lot of your programming just making sure your program doesn't blow up. vs. Newer Languges And the String class in C++ where you can concatinate get sub strings parse.... it makes doing such job much easier and a lot less anoying. Most well programed languges will not prevent you from getting anything done. However there is the Human element of the equasion if the syntax is to difficult for a particular job then the person will tire out and make more mistakes. The winner of this competition felt that ADA syntax offered him the ability to solve the problem better, thus helped him to win.

    I have written Web Apps in FORTRAN 77 just to prove that you can. However I wouldn't say it would be OK to consult a client to do the same, as it really isn't the right tool for the job.
  • by RebornData ( 25811 ) on Thursday May 15, 2008 @11:32AM (#23418570)
    Here's a recent cryptanalysis of SIGABA:

    http://www.sjsu.edu/mscs/research/projects/chan_wing-on.pdf [sjsu.edu]

    In normal use, it appears to have had a keyspace of about 48 bits, which is not easy to attack now with a modest distributed effort, but way out of the reach of WWII technology.

    However, a variant of the machine used for communication between the US President and British PM had an effective keyspace of 95+ bits, which (if you have access to some known plaintext) can be reduced to 86 bits, which although shorter than key lengths in common use today is still out of reach.
  • Re:ADA Resurgence? (Score:5, Informative)

    by Barromind ( 783894 ) on Thursday May 15, 2008 @11:52AM (#23418804)
    Ada 2005 is comparatively minor (although some changes, like interfaces, are not that minor). The real improvement was Ada 95. The 95 revision managed to standardize many things that C++/java are now settling.

    Ada is not trendy, but it has had built-in portable concurrency and many other killer features for more than a decade. Proper specifications are one of my favs.

    Of course there are other factors, like the lack of good and free compilers. Fortunately now the gcc toolchain has put this to rest. Also there are few libraries. Really few. Binding to C is easy, but still a deterrent for the hobbyist.

    It's emphasis in making maintenance easy over quick programming really pays in the end, not even in the middle/long term but shortly after getting familiar with the language. I find myself much more productive. When something compiles, I'm sure that the only bugs remaining are logical, not some funny pointer or unexpected type conversion or overflow. Nowadays I rarely fire the debugger more than once a month. My C/C++ has improved because Ada forbids the things that are considered bad practices in C/C++, but you still end doing because "you know better".

    I think that Ada is getting now more exposure because, albeit a niche language, Adacore is pushing hard behind it. Also, its SPARK derivative by Praxis has made some headlines with large and difficult projects getting flying marks. SPARK has made static analysis a reality for large projects.

    I'd say that anyone capable of discipline will enjoy the benefits of Ada. It's not the thing for quick hacking, but it is perfect for anything not trivial. Software engineers should love it. I have heard somewhere that it is a safe C++, and I concur: feature-wise is more or less on par, it catches bugs sooner and prevents many typical ones.

    Have I already said that concurrency is built-in and portable :P? And that inter-thread communication is really well done?
  • Re:Type Casting (Score:2, Informative)

    by fitten ( 521191 ) on Thursday May 15, 2008 @12:01PM (#23418946)
    That was pretty much my experience... when you finally got the Ada program to compile, it worked... it just sometimes took a lot of work to get it to compile ;) Back then, you had to be explicit in everything you wanted to do, particularly type conversion... of course, you could get around that by just using everything the same type, but if you started out typing everything, if you got your program to compile, you knew that you were always calling the right functions and/or always doing the typecasts you needed to do.
  • Re:Type Casting (Score:3, Informative)

    by kst ( 168867 ) on Thursday May 15, 2008 @12:06PM (#23419036)
    >> It doesn't allow for type conversion

    > It does (unchecked_conversion), but never (AFAIK) *implicitly*.

    Unchecked_Conversion reinterprets the bits of the argument as a value of the specified type.

    Ada also allows ordinary value conversions (for example, converting 3.1 to type Integer yields 3) among sufficiently closely related types; for example, a value of any numeric type can be converted to any other numeric type. It requires such conversions to be explicit in more cases than many other languages.

    And yes, my experience is that it's more common in Ada than in, say, C, for a program to work correctly the first time you get it to compile successfully.
  • Obvious.. (Score:2, Informative)

    by jovius ( 974690 ) on Thursday May 15, 2008 @01:34PM (#23420686)
    He obviously settled on Ada, because Ada allowed him to implement.
  • by default luser ( 529332 ) on Thursday May 15, 2008 @03:56PM (#23423456) Journal
    But in order to fall back to the post, firstly as noted, there are bit fields in C, and you can use them to represent sequences of bits in 90% of the cases where you need to.

    Ada has an equivilant with packed types. You can set the 'Size attribute on custom types with bit precision, and you can pack multiple custom types into a record just like bitfields. We use this to read in packed data from hardware all the time.

    The only major failing I found was using these for stream IO (file in/out): unless you redefine the stream attributes for the type, Ada will automatically assume that the minimum size of the type is 8 bits, and will resize fields smaller than this. Makes for a lot of fun when trying to figure out why your file format is wrong, or you read in incorrect data.

    C has bitwise operators that actually works (compared to Ada), which makes it a lot more suitable for bitmanipulation than Ada.

    Oh, hell yes. Bitwise operations in Ada are so clumsy they made me tear my hair out.

    C also treat arrays and pointers as the same, and pointers are not checked, and you can cast data and pointers to whatever you want, this is why it is suitable for low level memory manipulation.

    I don't consider treating arrays and pointers the same to be a huge benefit; it's more of a kludge. Anyway, you can get the same performance as C pointers by using Ada access types; just make sure your types are aliased.
  • by lordholm ( 649770 ) on Thursday May 15, 2008 @04:21PM (#23423854) Homepage
    "Ada has an equivilant with packed types. You can set the 'Size attribute on custom types with bit precision, and you can pack multiple custom types into a record just like bitfields. We use this to read in packed data from hardware all the time."

    Yes, this is true, and it is one of the areas where Ada is very nice, i.e. for doing packet decoding (though in my opinion, erlang is nicer in this aspect).

    The bad thing is that the syntax for declaring your packed records in Ada is a bit redundant.
  • by gigabyteme ( 1183625 ) on Thursday May 15, 2008 @06:33PM (#23425750)

    If I could type 90 wpm and never make a mistake, I'd be using Ada or Fortran today.
    Oh please. Once upon a time I used Ada as my primary language for several years and I simply don't understand all these "Ada is too verbose", or "Ada is too strictly typed for beginners to learn" type of comments. People making these comments have never used Ada. Ada code can be verbose and hard to read just like any other language, but most of the time good Ada code is concise and readable to the point where it's almost poetry and reads like natural language. Anyone can easily program in Ada as long as they understand data types. It is possible to code 1000s of new lines between compiles and have it compile perfectly on the first shot. I've done it and I'm definately not a "superstar programmer".
  • by john.r.strohm ( 586791 ) on Thursday May 15, 2008 @08:15PM (#23426898)
    Joachim also chose to work a much harder problem than you did.

    You worked with the symbolic cyphertexts. He worked with raw baseband audio from the radio receiver, complete with noise.

    You knew this, of course, because you RTFA.

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...