Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Loops, Arrays and Objects Simplify Repetitive Tasks with Loops A Closer Look at Loop Conditions

Loop & Cryptography

Hi everyone, this course was really interesting and I was wondering about what Dave says concerning cryptography.

I understand how it can be used to break code, but how could someone use this code to do some cryptography ?

Thanks in advance.

Victor Learned
Victor Learned
6,976 Points

Basically you could use this method to find passwords for accounts or even account name password combos given enough time. Hence the reason that banks and such limit the number of times you can incorrectly input the wrong password when signing into your accounts.

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

While I am not entirely certain the specific application in which Mr. McFarland is referencing, loops are used a ton in cryptography. If you have a given coded string in order to decode that string you generally loop through the decoding process until the coded string is found. There are many methods to do thing based on the cipher, key, and method of encryption.

There is a very good course on Cryptography put out by Stanford's Dan Boneh available through Coursera. If you are interested in cryptography basics I highly recommend the course. You will get some great practice with loops, arrays, and objects as well.

Happy coding,

Ken

Thank you Ken Alger and Victor Learned for your answers. I didn't know they were used that much in real life, I'm looking forward to have a closer look on this subject.