I am using apg
to generate password suggestions, and am using the -M
switch to include special keyboard characters:
apg -a 1 -n 1 -m 16 -x 16 -M SNCL
where:
-a, algorithm - 0 default pronounceable, 1 random unpronounceable
-n, number of passwords
-m, minimum length
-x, maximum length
-M, mode - S, Special symbol set, N, Numeral symbol set, C, upper Case symbol set, L, Lower case symbol set
A lot of online services are picky about which special characters can be used, so I want to be able to exclude the ones that are most often not allowed. But in order to do this I need to know what characters apg
is using as it's 'special symbol set'. Is there a way of extracting this data from somewhere? Ideally the actual characters not a description if possible, e.g. '%' not 'Percent'
So far as I can tell, the only way is to refer to the source. The characters for all sets appear to be contained in a single statically initialized array of
struct sym
:where
So you can write a little bit of C to iterate over the array and print the
ch
value if thetype
is equal toS_SS
, which gives the following: