less_retarded_wiki/hacking.md
2023-07-13 12:19:07 +02:00

16 KiB

Hacking

Not to be confused with cracking.

Hacking (also hackerdom) in the widest sense means exploiting usually (but not necessarily) a computer system in a clever way. In context of computers the word hacker was originally -- that is in 1960s -- used for very good programmers and people who were simply good with computers, the word hacking had a completely positive meaning; hacker could almost be synonymous with computer genius (at the time people handling computers were usually physicists, engineers or mathematicians), someone who enjoyed handling and programming computers and could playfully look for very clever ways of making them do what he wanted. Over time hackers evolved a whole hacker culture with its own slang, set of values, behavioral and ethical norms, in jokes and rich lore. As time marched on, computer security has started to become an important topic and some media started to use the word hacker for someone breaking into a computer system and so the word gained a negative connotation in the mainstream -- though many refused to accept this new meaning and rather used the word cracker for a "malicious hacker", there appeared new variants such as white hat and black hat hacker, referring to ethical and malicious hackers. With onset of online games the word hacking even became a synonym for cheating. The original positive meaning has recently seen some comeback with popularity of sites such as hacker news or hackaday, the word life hack has even found its way into the non-computer mainstream dictionary, however a "modern hacker" is a bit different from the oldschool hacker, usually for the worse (for example a modern self proclaimed "hacker" has no issue with wearing a suit, something that would be despised by an oldschool hacker). We, LRS, advocate for using the original, oldschool meaning of the word hacker.

Original Hacker Culture

The original hacker culture is a culture of the earliest computer programmers, usually smart but socially rather isolated nerds -- at the time mostly physicists, mathematicians and engineers -- who shared deep love for programming and pure joy of coming up with clever computer tricks, exploration of computers and freely sharing their knowledge and computer programs with each other. The culture started to develop rapidly at MIT in about the second half of 1960s, though other hacker communities existed earlier and in other places as well (still mostly at universities).

The word hack itself seems to have come from a model train club at MIT in whose slang the word referred to something like a project of passion without a specific goal; before this the word was used around MIT for a specific kind of clever but harmless pranks. Members of the model train club came to contact with early computers at MIT and brought their slang along. These early punch-card computers were expensive and sacred, hackers treated them as almost supernatural entities; in the book Hackers it is mentioned that those who were allowed to operate the machines were called Priests -- Priests would often carry out a little prayer to please the machine so that it would bless them with computation. During 60s and 70s so called phreaking -- hacking the phone network -- was popular among hackers.

Many ideas -- such as the beauty of minimalism -- that became part of hacker culture later came from the development of Unix and establishment of its programming philosophy. Many hackers came from the communities revolving around PDP 10 and ARPANET, and later around networks such as Usenet. At the time when computers started to be abused by corporations, Richard Stallman's definition of free software and his GNU project embodied the strong hacker belief in information freedom and their opposition of intellectual property.

The culture has a deep lore and its own literature consisting of books that hackers usually like (e.g. The Hitchhiker's Guide to the Galaxy) and books by hackers themselves. Bits of the lore are in forms of short stories circulated as folklore, very popular form are so called Koans. Perhaps the most iconic hacker story is the Story of Mel which tells a true story of a master hacker keeping to his personal ethical beliefs under the pressure of his corporate employers -- a conflict between manager employers ("suits") and hacker employees is a common theme in the stories. Other famous stories include the TV typewriter and Magic Switch. One of the most famous hacker books is the Jargon File, a collectively written dictionary documenting hacker culture in detail. A 1987 book The Tao of Programming captures the hacker wisdom with Taoist-like texts that show how spiritual hacking can get -- this reflects the above mentioned sacred nature of the early computers. The textfiles website features many text files on hacking at https://textfiles.vistech.net/hacking/. See also Ten Commandments for C Programmers etc. A lot about hackers can be learned from books about them, e.g. the free book Free as in Freedom about Richard Stallman (available e.g. here). A prominent hacker writer is Eric S. Raymond who produced a very famous essay The Cathedral and the Bazaar, edited the Jargon File and has written a large guide called How To Become A Hacker -- these are all good resources on hackerdom, even though Raymond himself is kind of shitty, he for example prefers the "open source" movement to free software.

As a symbol of hackerdom the glider symbol from game of life is sometimes used, it looks like this:

 _____
|_|0|_|
|_|_|0|
|0|0|0|

Let us now attempt to briefly summarize what it means to be a hacker:

  • Hacker is an artist who builds and creates, cracker is someone who breaks and destroys, many times due to being less competent or unworthy of true hacking -- destroying something is easier than creating something.
  • Hacker greatly values freedom, among which are the freedom of information, free software, free speech, free thinking, free access to computers etc. Therefore he supports sharing, even if it is called for example "piracy", and despises things going against said freedoms such as proprietary software, passwords (preventing information freedom), censorship, copyright, patents, pretense and deceit etc.
  • Hackers are non-conformists, reject authority and don't respect social norms; a hacker wears old cheap clothes, long hair and unkept beard without conforming to any fashion, he sees caring about looks as a wasted time that would better be spent by hacking computers. Hacker is a basement dwelling nerd without social life because he has rich inner intellectual life, he's usually a kisless virgin, even a wizard, partly because of his looks but also again because typical adult life would require him to do less hacking.
  • Hacker values fun and playfulness -- despite his serious dedication to the art, he hates seriousness of the business guys and "suits", as well as the self-centered, egoistic attitude of "modern hackers" who might see or present themselves as kind of superheroes. A hacker will give his programs funny names rather than names that would make for a good business product, a hacker will insert jokes in his source code (e.g. hex values such as 0xBEEFFACE), documentation and speech (Jargon File has a whole section on how hackers construct and use words).
  • Hacker aims for ingenuity, cleverness, elegance, minimalism, thinking out of the box etc. As such he loves math, puzzles, intellectual challenges (such as code golfing) and despises ugly commercial ways of mainstream technology, i.e. that which is bloated, hastily made to impress by visuals or cheap "killer features" while hiding ugly internals etc.
  • Hacker loves hacking and tinkering in itself -- hacking is the goal, not the means. Hacking is art and carries deep intellectual and even spiritual value. To a hacker it is a joy to program computers and he aims for nothing more than enjoy endless hours of programming, programming is NOT a tool to achieve low goals such as monetary profit or mainstream fame. Many hackers claim that hacking is better than sex (though it is questionable whether many of them have experience with the latter).
  • Hacker has strong opinions about technology, for example about what the best text editor or best programming language is. However hackers may also sometimes disagree which results in holy wars.

Let's mention a few people who were at their time regarded by at least some as true hackers, however note that many of them betrayed some of the hacker ways either later in life or even in their young years -- people aren't perfect and no single individual is a perfect example of a whole culture. With that said, those regarded hackers included Melvin Kaye aka Mel, Richard Stallman, Linus Torvalds, Eric S. Raymond, Ken Thompson, Dennis Ritchie, Richard Greenblatt, Bill Gosper, Steve Wozniak or Larry Wall.

"Modern" "Hackers"

Many modern zoomer soydevs call themselved "hackers" but there are basically none that would stay true to the original ethics and culture and be worthy of being called a true hacker, they just abuse the word as a cool term or a brand (see e.g. "hacker" news). It's pretty sad the word has become a laughable parody of its original meaning by being associated with groups such as Anonymous who are just a bunch of 14 year old children trying to look like "movie hackers". The hacker culture has been spoiled basically in the same ways the rest of society, and the difference between classic hacker culture and the "modern" one is similar to the difference between free software and open source, though perhaps more amplified -- the original culture of strong ethics has become twisted by capitalist trends such as self-interest, commercialization, fashion, mainstreamization, even shitty movie adaptations etc. The modern "hackers" are idiots who have never seen assembly, can't do math, they're turds in suits who make startups and work as influencers, they are tech consumers who use and even create bloat, and possibly even proprietary software. For the love of god, do NOT mimic such caricatures or give them attention -- not only are they not real hackers, they are simply retarded attention whores.

Security "Hackers"

Hacker nowadays very often refers to someone involved in computer security either as that who "protects" (mostly by looking for vulnerabilities and reporting them), so called white hat, or that who attacks, so called black hat. Those are not hackers in the original sense, they are hackers in the mainstream adopted meaning of someone breaking into a system. This kind of "hacker" betrays the original culture by supporting secrecy and censorship, i.e. "protection" of "sensitive information" mostly justified by so called "privacy" -- this is violating the original hacker's pursuit of absolute information freedom (note that e.g. Richard Stallman boycotted even the use of passwords at MIT, Raymond discourages from using anonymous handles and rather recommends going by your real name). These people are obsessed with anonymity, encryption, cryptocurrencies, cryptofascism and are also more often than not egoist people with shitty personalities. In addition they don't generally adhere to the original hacker culture in any way either, they are simply people breaking into systems for some kind of self benefit (yes, even the white hats), nothing more than that. Again, do NOT try to mimic these abominations.

Examples Of Hacks

{ As a redditfag I used to follow the r/devtricks subreddit, it contained some nice examples of hacks. ~drummyfish }

A great many commonly used tricks in programming could be regarded as hacks even though many are not called so because they are already well known and no longer innovative, a true hack is something new that impresses fellow hackers. And of course hacks may appear outside the area of technology as well. The following is a list of things that were once considered new hacks or that are good examples demonstrating the concept:

  • bit hacks: Clever manipulations of bits -- for example it is possible to swap two variable without a temporary variables by using the xor function. Another simplest example is implementing division by 2 as binary shift by 1 (this hack is used in real life by people for quickly dividing by 10, we just remove the last digit).
  • copyleft: A legal hack by Richard Stallman, connected to free software, working on the basis of the following idea: "If copyright lets me put any conditions on my work, I may impose a condition on my work that says that any modified version must not impose any restrictive conditions".
  • fast inverse square root: Famous hack that was used in the game Quake, it approxmates an inverse of square root of a floating point number by treating it as an integer and bashing it with a magic constant, which is about four times faster than computing the value with the obvious floating point division.
  • memory rape in C: E.g. instead of doing proper memory allocation with potentially inefficient and bloated malloc one may try to do a custom memory allocation without any libraries by abusing allocation on stack -- allocate a variable size array in main, set some global pointer to it and then manage this chunk of memory with your own allocation functions.
  • actually portable executable (https://justine.lol/ape.html): Justine Tunney found a way to create an executable format that passes as a valid NATIVE executable on all major systems including GNU/Linux, Windows and Mac, i.e. it is possible to compile a native program (e.g. with C) and then have it natively run on any major OS.
  • game of life patterns: Stable patterns such as glider or even programming game of life in game of life is a nice example of game hacking -- in fact exactly game of life hacking stood at the beginning of hacker culture.
  • bytebeat: A demoscene hack that utilizes integer overflows to create rhythm and produce music.
  • Computer graphics uses many clever tricks that could possibly be called hacks, e.g. in times when 3D graphics was primitive and didn't allow achieving such effects as mirror reflections easily, some games faked mirrors simply with a hole in the wall behind which the whole mirrored room was placed -- this achieved the same effect as a mirror and didn't require any extra rendering passes or shaders.
  • quine: A cleverly constructed self-replicating program in programming language that prints its own source code -- this is a common exercise of language hackers.
  • MetaGolfScript esoteric languages: rather than being a nicely designed code golfing language MetaGolfScript invents infinitely many languages, each of which solves one problem with a zero-length program, making it possible to win any golfing contest that allows arbitrary choice of language just by choosing the correct MetaGolfScript language.
  • TODO: moar

See Also