Note that there are some explanatory texts on larger screens.

plurals
  1. POKey generator method?
    primarykey
    data
    text
    <p>I really feel stupid for posting this but since i got no answers on my question and i am still junior programmer i will post this :</p> <pre><code> //List of keys byte[] Key0 = { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; //mode 10 = 0 byte[] Key1 = { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 }; // i + 2 byte[] Key2 = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 }; // i mode 2 = 0 byte[] Key3 = { 66, 77, 88, 99, 111, 222, 110, 112, 114, 115 }; // mode 11 = 0 byte[] Key4 = { 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121 }; //x^2 byte[] Key5 = { 6,17,34,57,86,121,162,209 }; //3x^2+2x+1 byte[] Key6 = { 77,78,79,80,81,82,83,84,85,86,87 }; // only in range //Add all keys to the list List&lt;byte[]&gt; oKeysList = new List&lt;byte[]&gt;(); oKeysList.Add(Key0); oKeysList.Add(Key1); oKeysList.Add(Key2); oKeysList.Add(Key3); oKeysList.Add(Key4); oKeysList.Add(Key5); oKeysList.Add(Key6); Random oRandom = new Random(); //Generate random key index to be used in the encryption int ListSelectedIndex = oRandom.Next(0, oKeysList.Count); byte[] GeneratedKey = oKeysList[ListSelectedIndex]; //Generate 3 random number from the selected key and concate the key index to it byte[] GeneratedBytes = new byte[4]; for (int i = 0; i &lt; 3; i++) { GeneratedBytes[i] = GeneratedKey[oRandom.Next(0,GeneratedKey.Length)]; } //Add the list of key index GeneratedBytes[3] = (byte)ListSelectedIndex; //Return the genreated bytes return GeneratedBytes; </code></pre> <p>As you see i generate this 4 byte array along with a 8 bytes generated with from RNG Cryptography, and when i want to check my serial i take the last 4 bytes and use the mathematical relations between them, I want to generate many serials and be able to check if they are valid or not. I know its probably pretty old method with a very bad security so please if any one could help me or add anything to my code or suggest anything new i would be really thankful.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload