rewrite to wrap all contents when encrypting