Added encrypt nil validation.