Skip to content

Instantly share code, notes, and snippets.

@suspectpart
Last active February 6, 2021 21:00
Show Gist options
  • Save suspectpart/6518c77ed117837324ae00f0d239aafb to your computer and use it in GitHub Desktop.
Save suspectpart/6518c77ed117837324ae00f0d239aafb to your computer and use it in GitHub Desktop.
Decipher Fefe Timestamps
"""
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