csg@pyramid.pyramid.com (Carl S. Gutekunst) (07/09/88)
In article <3375@phri.UUCP> roy@phri.UUCP (Roy Smith) writes: >When assigning passwords for incomming uucp accounts, I just type random >patterns on the keyboard. Or you can try this trivial little jewel. Output looks something like this: a[=lRCuV X4Bb<f?4 HkQE:LpE Suitable for grabbing and stuffing on a Sun or a 630. :-) <csg> _______________________________________________________________________________ /* * randpass.c -- generate really random passwords. For BSD Unixes only. * Includes all ASCII chars '0' through 'z', except '@' and '\\' */ #define PASSCHARS 8 main() { int i, c; char s[PASSCHARS+1]; long random(); srandom((int) time(0)); for (i = 0; i < PASSCHARS; ++i) { while ((c = random() % 75 + '0') == '@' || c == '\\') ; s[i] = c; } s[PASSCHARS] = '\n'; write (1, s, PASSCHARS+1); }