Noob here. I have some crypto questions.

If I multiplied the the encrypted letter by a random generated number, would it be possible to break the algorithm using frequency analysis??

It depends on how the numbers are randomly generated. A truly hard to predict psuedo-random number generator is one of the most basic and important tools in cryptography. You can make a secure cipher with a good one. In the example you provided, that's still not good enough. You're only providing three variations on each symbol, and the symbols are all being encrypted independently. If you encrypted a string of repeated "e"s here, your ciphertext would be all 18975, 37950, and 56925. It would be obvious that there's a pattern.

To learn, Wikipedia is a good place to start getting familiar with basic concepts. Stanford offers a free online course, next session starts April 20, https://www.coursera.org/course/crypto . And if you really want to get into it, check out one of Bruce Schneier's textbooks.

One more thing, how can some one not decrypt a clipher text while knowing the algorithm? May you please give me an example? I'm just curious.

Ok, this is a fundamental concept in cryptography. You have to assume that your adversary will know the algorithm. What they don't know is the key. Consider the Enigma machine in WWII for example. To disseminate encrypted information to their forces, there had to be lots of these machines spread among their forces, one for every group they want to receive important orders. They have to assume that eventually the Allies will capture one of these machines. There's too many out there to guarantee the security of them all, and they're big, heavy and metal and not that easy to hide or destroy. It will be captured and then they will know the algorithm.

The secret is the key, which in this case is the configuration of the machine. That's which of its gears you place in, in what order, in what starting positions, and how you set the plugboard on the front. That's a key they can change regularly, and they can send out codebooks with each day's code printed on it. This allows them to easily change the key at any time, and you can now easily analyze how many possible keys there are and so how long it will take an attacker to try them.

If all you have for a cipher is an unalterable algorithm with no defined keyspace, then you're in trouble. What do you do if the enemy finds out? You can't just switch keys, instead you have to invent a whole new algorithm. Very bad idea. If you're using a cipher for communicating between many people, they all know this algorithm and any of them could lose control of it. Keys give you the agility to change quickly and a known, large selection of keys to change to.

A modern block cipher like AES256 for example has a 256 bit key, so that's 2256 possible values. That's an overwhelmingly huge number, it's more than the number of atoms in the observable universe. Every 256-bit value is an equally valid key. So you can easily change keys, and you can rest assured that an attacker will never have time to guess it.

If you look at classical ciphers, a Caesar shift has 26 keys (or however large your alphabet is). That's far too low. A random substitution table (just a list of every letter and what to swap it with) has 26 factorial keys, which is about 88 bits, enough to be secure even against modern computers, BUT it does nothing to mask the frequency fingerprint, so it's still trivially cracked.

A polyalphabetic cipher has 26n keys, where n is the length of your keyword. This does do some frequency masking, but not enough if you encrypt more than a very short amount of text.

And hopefully you already know this, but don't actually use any cipher you invent. A strong cipher is very challenging to design and you should never trust anything to one that hasn't be thoroughly reviewed by professional cryptographers.

/r/cryptography Thread