Encryption, hashing, message authentication and more

This short php code contains a critical vulnerability. In this video I will explain in detail what I think while analysing it.
This challenge was part of the FLARE-On 2018 CTF. In this video we reverse engineer a basic windows .exe to find out how to win the game. At first we tried to attack the weak crypto but failed. At the end it turns out I had a bug in my code :(