         if let data = string.dataUsingEncoding(Default.TEXT_ENCODING) {
             do {
                 let encryptedData = try CryptoHelperTests._cryptoHelper.encryptData(data)
-                let encryptedBase64Data = encryptedData.base64EncodedStringWithOptions(.EncodingEndLineWithCarriageReturn)
-                let decryptedString = try CryptoHelperTests._cryptoHelper.decryptString(encryptedBase64Data)
-                XCTAssertEqual(decryptedString, "martin")
+                if let dataString=String(data: encryptedData, encoding: Default.TEXT_ENCODING) {
+                    let decryptedString = try CryptoHelperTests._cryptoHelper.decryptString(dataString)
+                    XCTAssertEqual(decryptedString, "martin")
+                } else {
+                    XCTFail("Error during NSData encoding")
+                }
+
 
             } catch {
                 XCTFail("\(error)")

    func testEncryptStringDecryptData() {
        // Given a string
        let string = "martin"
        // If we encrypt it
        do {
            let encryptedString = try CryptoHelperTests._cryptoHelper.encryptString(string)
            // we get an encrypted base64 string
            XCTAssertEqual(encryptedString, "eTCPvyGC1XPax9XAwdBDdQ==")
            // Let's convert the encrypted base64 string to an encrypted buffer
            if let encryptedData = NSData(base64EncodedString: encryptedString, options: [.IgnoreUnknownCharacters]) {
                // If we decrypt it
                let decryptedData = try CryptoHelperTests._cryptoHelper.decryptData(encryptedData)
                // And convert its content to a string

                // If we encrypt it
                let encryptedData = try CryptoHelperTests._cryptoHelper.encryptData(data)
                // we get an encrypted buffer
                // Commented by bpds > @md this assertion is irrelevant.
                //XCTAssertEqual(encryptedData.base64EncodedStringWithOptions(.EncodingEndLineWithCarriageReturn), "FacTvJN9YQVRqzW8mCuy4w==")
                // If we decrypt it
                let decryptedData = try CryptoHelperTests._cryptoHelper.decryptData(encryptedData)
                // we get back our original buffer
