How long would it take to brute force a 32 or 16 bit integer and which type of processor would brute force this in the shortest period of time I was actually wondering... How long would it take to crack/brute force a 32 bit key/encryption and a 16 bit key/encryptions respectively on a 4GHZ and a 2GHZ PC. I know that a 32 bit integer has 4,294,967,296 combinations while a 16 bit number has exactly 65,536 combinations but I don't know how long It'll take. and what processor would be able to brute force this in the shortest period of time
$4,294,967,296ops/4,000,000,000ops/s=1.07s$
$65,535ops/4,000,000,000ops/s=16.4μs$
2GHz twice that.
That's per-core. So 8 cores = 1/8 of a second or so. 64-core/128 thread 2GHz Threadripper = about 16ms.
A GPU will be even faster. It's recommended to brute force the entire 2^32 space for testing various numerical functions, it's fast and catches all the edge cases you might not have thought about. Brute forcing 2^64 values takes a month or so on a fast GPU, easily doable faster on a GPU cluster.
Edit, thanks to kelalaka: a Tesla V100 can run about $2^{47}$ SHA-1 hashes/hour. SO $720hours/month\times2^{47}Hashes/hour\approx2^{56}Hash/month$. That's about 182 months total, but each hash is substantially more work than just incrementing an integer, so a faster operation can likely be brute-forced in a month on such a GPU. Slower operations need a cluster, but such clusters can be rented from various cloud providers.