Last active
February 6, 2021 21:00
-
-
Save suspectpart/6518c77ed117837324ae00f0d239aafb to your computer and use it in GitHub Desktop.
Decipher Fefe Timestamps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
https://blog.fefe.de/?ts=bcb518f6 | |
Timestamp: bcb518f6 | |
Date: Thu Mar 31 2005 | |
""" | |
from datetime import datetime | |
def defefe(ts): | |
""" | |
Decrypt hex-encoded POSIX timestamps. | |
https://en.wikipedia.org/wiki/XOR_cipher | |
""" | |
xor_cipher_key = 0xfefec0de | |
posix_timestamp = int(ts, 16) ^ xor_cypher_key | |
return datetime.fromtimestamp(posix_timestamp) | |
print(defefe("bcb518f6")) # 2005-03-31 12:59:52 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment