Pure JS implementation of SecureStorage API