Modern Cryptography Primer: Theoretical Foundations and Practical Applications