Doom cheat code encryption

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
Line 4: Line 4:
 
|released=1993
 
|released=1993
 
}}
 
}}
'''Doom cheat code encryption''' was used in the original 1993 version of Doom to make the cheat codes a little harder for hackers to find, so they didn't appear in the raw binary code as plain [[ASCII]] characters. Twitter user [https://twitter.com/Foone @Foone] described it in a 2019 thread.
+
'''Doom cheat code encryption''' was used in the original 1993 version of Doom to make the cheat codes a little harder for hackers to find, so they didn't appear in the raw binary code as plain [[ASCII]] characters. (Of course, the hackers found them anyway.) Twitter user [https://twitter.com/Foone @Foone] described it in a 2019 thread.
  
 
This low-grade encryption is done by shifting the bits of 8-bit numbers (which can represent single ASCII characters) which reverses the order of the bits except for those representing 4 and 32. The shifted values are stored in a lookup table in the Doom program.
 
This low-grade encryption is done by shifting the bits of 8-bit numbers (which can represent single ASCII characters) which reverses the order of the bits except for those representing 4 and 32. The shifted values are stored in a lookup table in the Doom program.
 +
 +
== Details ==
 +
 +
As described by @Foone, who has [https://twitter.com/Foone/status/1190656026342637569 allowed his descriptions to be released as CC0] so they can be used here:
 +
 +
:So Doom (1993) has a neat bit of encryption in it. It's not very strong encryption, but it's still encryption.
 +
And it's not used in any sort of way you'd normally expect: not copy protection, or multiplayer anti-cheat, or anti-tampering on saves... It's to slow down FAQs.
 +
 +
:So here's the code I'm talking about, the macro SCRAMBLE
 +
It looks annoyingly complicated but it's not, really.
 +
It's taking an 8-bit number and shifting around some of the bits.
 +
 +
[[File:Doom-cheat-code-encryption-01.png]]
 +
 +
:If you diagram out what's happening, it makes slightly (BUT ONLY SLIGHTLY) more sense.
 +
It kinda looks like they started with a a "reverse the order of these bits" function but then switched it so the 4 and 32 don't get switched, they just go straight through.
 +
 +
[[File:Doom-cheat-code-encryption-02.png]]
 +
 +
The thread goes on to describe the lookup table used to find these values, and the cheat codes embedded in encrypted form, and more discussion of how they were used and discovered. It's worthwhile reading for people into this sort of trivia.
  
 
== Links ==
 
== Links ==

Revision as of 18:02, 2 November 2019

File Format
Name Doom cheat code encryption
Ontology
Released 1993

Doom cheat code encryption was used in the original 1993 version of Doom to make the cheat codes a little harder for hackers to find, so they didn't appear in the raw binary code as plain ASCII characters. (Of course, the hackers found them anyway.) Twitter user @Foone described it in a 2019 thread.

This low-grade encryption is done by shifting the bits of 8-bit numbers (which can represent single ASCII characters) which reverses the order of the bits except for those representing 4 and 32. The shifted values are stored in a lookup table in the Doom program.

Details

As described by @Foone, who has allowed his descriptions to be released as CC0 so they can be used here:

So Doom (1993) has a neat bit of encryption in it. It's not very strong encryption, but it's still encryption.

And it's not used in any sort of way you'd normally expect: not copy protection, or multiplayer anti-cheat, or anti-tampering on saves... It's to slow down FAQs.

So here's the code I'm talking about, the macro SCRAMBLE

It looks annoyingly complicated but it's not, really. It's taking an 8-bit number and shifting around some of the bits.

Doom-cheat-code-encryption-01.png

If you diagram out what's happening, it makes slightly (BUT ONLY SLIGHTLY) more sense.

It kinda looks like they started with a a "reverse the order of these bits" function but then switched it so the 4 and 32 don't get switched, they just go straight through.

File:Doom-cheat-code-encryption-02.png

The thread goes on to describe the lookup table used to find these values, and the cheat codes embedded in encrypted form, and more discussion of how they were used and discovered. It's worthwhile reading for people into this sort of trivia.

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox