__Login__or

__Take a Tour__!

- Cryptography is fascinating. Seriously, way more interesting than I thought it would be. I knew some history about Turing and Enigma, especially from [Neal] Stephenson’s

*Cryptonomicon*, but getting into the nitty gritty was really worthwhile.

The good news here is that there is really only one book you need to read. *The Code Book*, by Simon Singh, is a masterpiece.

#learnnewthings schedule:

January 2016 – Water and growth in California

February – Wine

March – Game theory

April – Cryptography

May – Art history

June – The history of railroads in the U.S.

July – Oceanography

August – Football (strategy and theory)

September – Chaos theory

November – Linguistics

Aw man, I wish I would have seen this last month. Maybe this stuff will be interesting for anyone else that wants to learn more about cryptography, or you if you have some extra time. :)

So one thing I've learned about cryptography is to *never* roll your own crypto libraries. Cryptography's security is rather binary: it's either perfectly implemented and secure, or imperfectly implemented and insecure. One crack in the armor will take down the whole thing. And apparently cryptography implementation is non-trivial. Many complex considerations must be taken into account-- things that people like you and me don't know enough to not do. Things like how intermediate computations are stored in memory, and even things like information gleaned from how much time it takes for the algorithm to execute. So use widely-used crypto libraries that have been audited by security expert peers. On a related note, be very suspicious of any company that creates their own cryptographic algorithm instead of using an existing one. Like Telegram.

A really good resource is the Matasano Crypto Challenges, which will teach you a ridiculous amount about cryptography through *breaking faulty implementations of it*.

Another cool thing is this comic which teaches how AES works, and is surprisingly detailed and accurate.

*never*roll your own crypto libraries

From Bruce Schneier's blog I have learned that the weak point is almost always implementation; when vetted cryptography tools are employed no one bothers to attack them and rarely needs to.

- this comic which teaches how AES works

It is ridiculous how much easier it is to absorb an explanation when a stick figure presents it to you. You think you are reading a comic, before you know it you are reading Korean.

- This is curious actually. Would you mind giving some example of such deductions / conclusions in crypto?

https://en.wikipedia.org/wiki/Timing_attack

- Do you have any tips for after I'll finish that?

Unfortunately, I don't. I'm a baby to crypto. Besides the Matasano Crypto Challenges I posted above, I don't have any other resources to share.

Applied Cryptography is still the best introductory crypto book I know of, but really the hard parts are number theory and information theory, not cryptographic applications. It'll be much easier going if you learn a bit of both before studying cryptography proper. You can grab A Computational Introduction to Number Theory and Algebra from the author's site. The learning parts aren't relevant to cryptography, but Information Theory, Inference and Learning Algorithms is a good introduction to information theory, and you can grab pdfs off his site too. Also he's posted lectures since the last time I looked; I haven't watched them, but they might be worth checking out.

- Hacking Secret Ciphers with Python

I see the page also mentions *The Code Book* first among the paid resources. I think I'll start there, and stick with Project Euler for Python practice. Thanks for the suggestions.

I use the project as an opportunity to try learn new tools, and sometimes rely on features of a different language. Here's my breakdown of solved problems:

63 in Python (I solved the early problems while learning Python)

34 in C++ (when my old hardware was not fast enough)

13 in Ruby (when date functions were especially helpful)

13 in C# (slow days at work)

2 in Excel (shame!)

1 in Rexx (showing off)

I admit I find it difficult to believe that many of the problems beyond the first few dozen could be solved on paper, but I have learned that there are often clever shortcuts. Working through the Chakravala algorithm on paper was a sublime experience. I boasted to a friend that I had solved #24 on paper; he responded by solving it in his head.

My "friend key" is 16971_95168666b3371fa8a7b6548b677ce57c in case you care to observe my progress.

- if you never took linear algebra class it would be unlikely to occur to you" type of tip.

That highlights my main issue with the format of project Euler and why I abandoned it.

If you *happen* to know the area of maths that the question requires it can be challenging but fairly straightforward. If you **don't**, it's incredibly difficult or next to impossible and there aren't many (if any) clues about HOW you could gain enough background knowledge to solve it. All discussions about a particular problem, methods or maths tools to help solve it are locked away in the forum and you need to have solved it already before you can read it.

Thanks and please do continue!

There's quite a bit to digest and read there. Most of it seems to be what I've learned at school/university (and since mostly forgotten about), but it's nice to have it presented in this way i.e. important fundamental ideas in a particular area.

I **am** definitely interested in more but it'll take me some time to get through this post and I'm just about to start work. I'll come back once I've finished work.

The first 3 that I haven't solved yet are 93, 94 and 100. 94 is a triangle problem!

I think part of the problem is that I'm not used to reasoning about maths very much these days, so I can take a step or two and then hit a brick wall.

But seriously don't put time into this that could be used preparing for your exam. I can wait.

So I solved 94! Thanks for the tip.

In order to solve it I took your approach, and failed. I assume because not every n, n, n ± 1 forms a valid triangle and my filtering was obviously wrong. Using brute force feels wrong, but of course I do use that. It just seems like there must be a better approach and the large numbers in the questions are obviously there to discourage brute-force.

My winning approach was to generate pythagorean triples (as I already had code to do just that) and use those which apply to the question. Although relatively slow (still < 1 minute) it got me into the forum which shows a couple of much faster, very direct approaches to the solution.

Since lots of Euler questions involve solving for integers - often with 2 variables - I'd like to request an introduction to diophantine equations - and I keep coming across Pell's equation in the forums which looks like it's related.

- Ad. 93 ... I would love to get explanations and tips myself actually.

Once you've solved it you get a link to a forum topic for that question. There are usually lots of good advice in those.