Skip to content

Instantly share code, notes, and snippets.

@JayFoxRox
Created February 28, 2023 19:07
Show Gist options
  • Save JayFoxRox/2c41ac7307443651f341d39b4bd3088c to your computer and use it in GitHub Desktop.
Save JayFoxRox/2c41ac7307443651f341d39b4bd3088c to your computer and use it in GitHub Desktop.
Decryptor for the Fortnite Chapter 4, Season 1 / 2 encrypted Cipher Quests
#!/usr/bin/env python3
#
# Decryptor for the Fortnite Chapter 4, Season 1 / 2 encrypted Cipher Quests.
#
# The scheme for the encryption has been described here:
# https://twitter.com/realNumberSets/status/1630581327018831883
#
# Example:
#
# % ./fortnite-decrypt.py 19.19.19.1.27. 1.22. 22.16.15.10.20.21. 2.17.26.12
# SPRAY AT SPLITS BOWL
#
import sys
inputStrings = " ".join(sys.argv[1:]).split(" ")
keyNumberStrings = "0.3.1.0.2.0.2.3".split(".")
# Encryption starts with letter A, at position 1
base = ord('A') - 1
result = ""
keyIndex = 0
for inputString in inputStrings:
numberStrings = inputString.split(".")
for numberString in numberStrings:
if numberString.strip() == "":
continue
keyNumberString = keyNumberStrings[keyIndex % len(keyNumberStrings)]
keyIndex += 1
result += chr(base + int(numberString) - int(keyNumberString))
result += " "
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment