From the verb to crack. Hard "bread/biscuit" sense first attested 1739, though "hard wafer" sense attested 1440.
Sense of computer cracker, crack, cracking, were promoted in the 1980s as an alternative to hacker, by programmers concerned about negative public associations of hack, hacking (“creative computer coding”). See Citations:cracker.
Various theories exists regarding this term's application to poor white Southerners. One theory holds that it originated with disadvantaged corn and wheat farmers ("corncrackers"), who cracked their crops rather than taking them to the mill. Another theory asserts that it was applied due to Georgia and Florida settlers (Florida crackers) who cracked loud whips to drive herds of cattle, or, alternatively, from the whip cracking of plantation slave drivers. Yet another theory maintains that the term cracker was in use in Elizabethan times to describe braggarts (see crack (“to boast”)). An early reference that supports this sense is a letter dated June 27, 1766 from Gavin Cochrane to the Earl of Dartmouth:
I should explain to your Lordship what is meant by crackers; a name they have got from being great boasters; they are a lawless set of rascalls on the frontiers of Virginia, Maryland, the Carolinas and Georgia, who often change their places of abode.