first encryption implementation