      - returns: A decrypted buffer
      */
     public func decryptData(data: NSData) throws ->NSData {
-        if CryptoHelper.DISABLE_CRYPTO {
-            return data
+        if let b64Data=NSData(base64EncodedData: data, options: [.IgnoreUnknownCharacters]){
+            return try self._encryptOperation(CCOperation(kCCDecrypt),on:b64Data)
         }
-        return try self._encryptOperation(CCOperation(kCCDecrypt), on:data)
+        throw CryptoError.DecryptBase64Failure
     }
 
 

     - returns: A string
     */
    public func decryptString(string: String) throws ->String {
       if let data=NSData(base64EncodedString: string, options: [.IgnoreUnknownCharacters]) {
            let decrypted=try decryptData(data)
            if let decryptedString=String(data: decrypted, encoding:Default.TEXT_ENCODING) {
                return decryptedString
            } else {
                throw CryptoError.CodingError(message: "UTF8 string encoding error")
            }


        }
        throw CryptoError.CodingError(message: "Base 64 decoding has failed")
    }

    /**

        case KeyIsInvalid
        case ErrorWithStatusCode(cryptStatus:Int)
        case CodingError(message:String)
        case DecryptBase64Failure
    }


