Triangular Congruential Generator Block Cipher v1.2 by CharCoding, 2018, All Rights Reserved.
DISCLAIMER: I know next to nothing about cryptography and I just committed a sin by "rolling my own crypto". I am not responsible for any important data
leaked through this cipher. Use at your own risk, and use industrial strength RSA or AES for encrypting important information instead.
That being said, you're always welcome to break this cipher and show me how you did it.
I tried to comment my code and write it in a somewhat clear structure, hopefully it helps.
Challenge: Find the key from the following information:
Mode of operation: ECB
. Rounds: 5
Plaintext:
Triangular congruential generators differ from LCGs by having an intermediate step that finds the triangular number of the previous output first and using it to calculate the next output. This simple change avoids many of the weaknesses of LCG, such as the n-th least significant bit has a period of 2^n. This is not the case in TCG, as all bits have an equal, maximal period. For a visualization of the said improvement, visit https://jsfiddle.net/CharCoding/f90q2wo0/1/ .
Ciphertext:Q1LbbKlyzLArWWOZIixCwSaeRz4IphuTep+EC2ALfDDJcsxKGGESsqqexIIhCxGwBnBiSg0mNpYfz+K6fHj1GLfWqPVQyWuGt5lRovmKVtI2Jc4NpjsGRg5UR0JspFimkBWK4oSNYiwHYNfe0nfdV/9b5JCqUSCvTCycjZcvdEztn+Q352qOs1HFp/+0GalYOThiUGpF37ikoRW2ovgalGavr6kPf2Nw/1ILZNSr7BWOw2yxL3QG6jK9ZVL3mUJCRLXGOC8uTQUe/T8A8nxJrHKfujVYqXiKfhieDLHQhNcEKeHMXpG4geDE9LJyFCugis/ujnBK+gjFxg6YS1loXhULUcEb8byK+zXDiJkOLO/jywYuEtjROMlRZy3PplzIHBVYJLPHQyfiVUSapC8h9/y95SAbYxuxu+lkus1eiovaRoSVnXsjQEUTBy4uvN5LExURP/wLVd5pNKrCwINP6Kt7GflH+pSOhX7mwwEVqrL/ZUzuPQ38wqOvMjN47Bg0JLajCMXmnO5kNlcriZWGm6RwIBapaz1cegZG8t6AQQvp/D7yW5xD+MVW88Ol8YN2PRB1QgzMT+AULw545nVWKP2JL3SDYvbWszRYbdQu9wPug+5xEswTMdBD5+kYAUKO