start of encrypt abstraction layer