Algebraic Frameworks For Cryptographic Primitives