Using simple linear algebra for encryption? e.g.
the character $a = 97$ (it's computer decimal format, commonly known)
and then using a pattern/key like $y = 31 x + 5$ to get $3012$ (substitute $97$ into $x, y$ is now the encrypted code).


*

*How easy/hard would it be for someone to crack a code like this? 3012 3197 3135 (without them knowing the pattern)

*If someone had these encrypted codes, are there any methods they could use besides trial and error to figure out the pattern and then the code?
 A: What you have described is nothing more than a single-alphabet substitution cipher.  This sort of cipher has been around for centuries, with variations on the type of mapping.  It is very easy/simple to break if given enough ciphertext encoded with the method.
To break this cipher, first analyze the frequency of the resulting numbers.  (e.g. 3012 occurs what percent of the time in the message?)  Now, compare this to a frequency table of letters in the English alphabet.  This will give you a starting place.  You can also look at the frequency of pairs of letters.  By that time, you should have a pretty good guess for the substitutions.
A: If you put the spaces in, it is quite easy.  You wouldn't have to find $31x+5$, as there will only be $26$ (or $52$ or so if you use caps and punctuation) four digit blocks.  Just checking letter frequencies will make it easy to find $3102=a$ and so on.  It is like solving the substitution cypher in the daily newspaper.
If you don't put the spaces in, it will be a little harder.  A bit of creativity would find that the four digit blocks repeat.  Thinking in this direction, the $31x+5$ is probably easiir to see, but you could proceed as above.
