Beta

Kerckhoffs's principle

Description:

A cryptosystem should be secure even if everything about the system, except the key, is public knowledge. (Auguste Kerckhoffs, 1883)

Story
Company "Evil, Inc." dominates the world now. They sell their software for ridiculous prices and deny access to it to whoever opposes them. We, the Resistance, managed to get the source code for their license check algorythm and it seems vulnerable. Maybe we can generate license keys on our own...

Formal problem
Test cases section contains the cryptosystem code. Kata.Keygen should return such license byte array for given productID and envID, so that Evil.Protection.CheckLicense(license, productID, envID) returns true.
envID is a (unique) identifier of a computer we generate license for, and (as can be seen in test cases) is completely random. productID is assigned to products by "Evil, Inc." and precise rules of its generation are unknown.
Evil.Crypto.Encrypt takes in 64-bit block and key consisting of three 16-bit parts (if passed objects have more bits, only this many rightmost bits are used).

Notes and hints
-- Solutions which try to modify global variables, change testing code or otherwise cheat testing system are not welcome. This kata is about overcoming the cryptography challenge, not bypassing it.
-- Bit size of block and key are relatively low to keep within standard types, not because puzzle can't be expanded. So, basically, bruteforce for 48, 32 or even 24 bits isn't a correct solution, even if you can optimize it to be fast enough to pass tests.
-- Test cases provide some existing licenses. Look through them, they may be useful.
-- You may use Evil.Crypto and Evil.Protection classes in your own code.
-- Useful reading (wiki): Feistel cipher, block ciphers in general. Also, good book to read is "Practical Cryptography" by Niels Ferguson, Bruce Schneier.

Credits

Cryptography
Bits
Puzzles
Security
Ciphers

More By Author:

Check out these other kata created by Absurdated

Stats:

CreatedMay 1, 2015
PublishedMay 8, 2015
Warriors Trained218
Total Skips117
Total Code Submissions22
Total Times Completed6
C# Completions2
Java Completions5
Total Stars5
% of votes with a positive feedback rating100% of 0
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes0
Ad
Contributors
  • Absurdated Avatar
  • hobovsky Avatar
Ad