4 Answers
4

factor first appeared on 5th edition Research Unix in 1974, as a "user maintained" utility (section 6 of the manual). In the 7th edition in 1979, it was moved into the main "commands" section of the manual (section 1). From there, the factor utility was copied to all other variants of Unix, including commercial Unixes and BSD. In some variants of Unix, it is classified as a "game" more than a serious utility, and therefore documented in section 6.

So it would seem that some user(s) liked to play around with prime factors and wrote factor - and once it existed, there probably was no good reason not to include it as a command in subsequent Unix versions. So the "practical uses" of factor may depend on what you consider practical - if you are into prime number theory, it is probably a great tool/game/whatever.

Thanks, I kind of got this from the man page. I was more curious why you would want to do this in a shell script, or similar. How often do people actually need prime roots? I updated the question to be clearer.
–
Gavin BrockSep 5 '12 at 2:24

factor is limited to numbers that fit into an unsigned integer. Best case, that's 64 bits (≤ 18,446,744,073,709,551,615)—but the smallest number you'd reasonably use in e.g., RSA is 2048 bits. IOW, That's much larger than factor can handle. In fact its so much larger, that writing out how many times larger exceeds the maximum length of a comment. It's almost 600 digits long (it's 2¹⁹⁸⁴ if you want to calculate it yourself with e.g., bc)
–
derobertDec 10 '12 at 20:06

So not useful today, but maybe 35 years ago? Was cryptography using keys with that high of entropy then? Just thought it might be a possible reason it exists.
–
Drake ClarrisDec 10 '12 at 21:25

No. If factor can factor the number (without chugging for many, many years on it), then it is useless for cryptography. Also, I bet factor uses a relatively slow algorithm...
–
derobertDec 10 '12 at 21:30