Join Nostr
2026-08-17 06:30:05 UTC
in reply to

Ge0rG on Nostr: nullenvk :blobcat2: At least they aren't hashing the output of rand(), then throwing ...


At least they aren't hashing the output of rand(), then throwing it away and returning uninitialized stack instead, like Samsung did in a production crypto implementation a while ago!

```
char *_secureRandom(int *result) {
srand(time(0));
char *target = String_new(20,result);
String_format(target,20,"%d",rand());
target = _sha1_byte(target,result);
return target;
}
```
(the _sha1_byte() function doesn't quite do what the name implies)