The value is limited with '%255'. This gives a value in the range of 0..254.
This should be '&255' (or equivalently '%256'), which gives the range of 0..255.
Obviously rand() should not be used for generating keys in any serious application, but the README already states this code should not be used for serious applications, so the use of rand() is not a problem.
The value is limited with '%255'. This gives a value in the range of 0..254.
This should be '&255' (or equivalently '%256'), which gives the range of 0..255.
Obviously rand() should not be used for generating keys in any serious application, but the README already states this code should not be used for serious applications, so the use of rand() is not a problem.