Added channel wrapping functionality to support encryption