4 ms·
Doing your own crypto is generally hard and risky, but with a little googling there are often reasonable defaults and suggestions available from trustworthy sou
by nieve 13y ago
Doing your own crypto is generally hard and risky, but with a little googling there are often reasonable defaults and suggestions available from trustworthy sources. The biggest danger seems to be that people pick some random set of values & constructions and assume that's good enough without further checking.
On the flip side this should have set off warning bells for them - it can be a little bit of a code smell to pick 1 for a configurable value in your encryption. Not always a bad choice, but 1 has a lot of properties that can simplify various mathematical operations and Basically setting a crypto value to the smallest positive integer (and a non-prime at that!) is like deciding that a set of numbers in your code should always be represented by two-byte signed ints. Sometimes that's _exactly_ what you want (say, various fast math libraries), but if you're doing general purpose code you should really stop and think about whether you might end up with a value outside that.