What is the difference between LCG and Affine cipher?
More specific: What are they used for, and what are the structural differences between them?
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It only takes a minute to sign up.Sign up to join this community
A LCG -- linear congruential generator -- is used to generate a sequence of pseudorandom numbers. Therefore, it takes the previous output to calculate a new number:
yi = (a*yi-1+c) mod N
With an Affine cipher, in contrast, you can encrypt and decrypt. You can convert your text to a number; for example, character for character "A"->0 "B"->1... "Z"-> 25
To encrypt a message m you use the following formula:
c = (a*m + b) mod N