Avoid buffer change while encrypting data