Having an api in gpgme(++) where I can request n random quality integers between x and y for generating strong passwords and others would be nice.
Description
Description
Event Timeline
Comment Actions
Why do you need an integer - for real random this must be larger than 64 bits and then you have problems to to find a suitable type for a variable.
Comment Actions
What I would like to be able to do would be:
string createPassword(int length) { string alphabet = "abcdefg..ABCDEFG..123-_<>l..."; integer_list randomnumbers = context.get_random_numbers(length, 0, strlen(alphabet)); string password; for (int i : randomnumbers) { password.append(alphabet[i]); } return password; };
without having to get correct the cornercases of chopping bits into whole numbers and scaling them down in a sane and secure way.
Comment Actions
It might actually be useful to have an random number API in gpgme. When we do that we can also add a way t search for random numbers with an upper limit in each octet.