#!/usr/bin/env python
# coding=utf-8
from subprocess import call
import time

message = """
If you could see
That I'm the one
Who understands you,
Been here all along.
So, why can't you see
You belong with me.

Standing by and waiting at your backdoor.
All this time how could you not know, baby?
You belong with me,
You belong with me.
"""

call(["clear"])
print("Creating a file with the following contents:")
time.sleep(2)
call(["touch", "hello.txt"])
f = open("hello.txt", "w")
f.write(message)
f.close()
call(["cat", "hello.txt"])
time.sleep(7)

call(["clear"])

print("Encrypting the file with Litaecrypt")
time.sleep(3)
call(["./litaecrypt", "-e", "hello.txt"])
time.sleep(5)

call(["clear"])
print("Encrypted file contents")
time.sleep(3)
call(["xxd", "hello.txt.lit"])
time.sleep(5)

call(["clear"])
print("Bruteforcing for the key")
time.sleep(3)
call(["./bruteforce", "hello.txt.lit", "hello.txt"])
time.sleep(7)


call(["clear"])
print("Comparing the two keys")
time.sleep(3)
print("The key generated by the program:")
call(["cat", "key.lit"])
time.sleep(3)
print("\n")
print("Key found by bruteforcing:")
call(["cat", "newkey.lit"])
print()
