title: Is a phrase a good code?
body: <h2>Introduction</h2>
  <p>I am working at a &quot;prize codes&quot; system for my website: the administrators can assign credits to an user, giving them a code that they can redeem.<br />
  The idea itself is quite easy to implement: generate (I'll assume the algorithm to be hardly-predictable) the codes, store them in a safe database and give administrators the power to read one random code. But I found that some features I want, do collide:</p>
  <ol>
  <li>The code must reasonably resist to attack with a reasonable computation power;</li>
  <li>There must be a large number of codes,  1 million;</li>
  <li>The code must be easy to type.</li>
  </ol>
  <p>I thought of these solutions, until now:</p>
  <p>After some thinking, I came up with this solution: using phrases of N words [I'm not talking about THE &quot;n&quot; word. I mean, &quot;N times a random word&quot;]. This seems to be a good idea, but I'm not experienced in this field.</p>
  <h3>Question 1</h3>
  <p>Is it safe to use phrases for codes? If yes, how many words should I use in order to be safe enough? [Assume an average length and the words an 8-years-old children knows.]</p>
  <h3>Question 2</h3>
  <p>Given a list of words, what is the best way to store them into the database?</p>
  <ul>
  <li>Desktop-side, generate a file with the desired phrases, then read and put them into the database using PHP?</li>
  <li>Server-side, reading a list of words and writing the phrases directly into the database?</li>
  <li>Other ways?</li>
  </ul>
  <p>Please note that I can't just let the administrators read the phrases files, as it is harder to code than using a database. Also notice that the words must be in common Italian: I estimate from 4.000 to 6.000 words to be used.</p>