Heimdall is a wrapper around the Security framework for simple encryption/decryption operations.

Overview

Heimdall Helmet

Build Status CocoaPods compatible Carthage compatible

Heimdall

In Norse mythology, Heimdall is the gatekeeper of Bifröst, the rainbow road connecting Midgard, realm of the humans, to Asgard, the realm of gods.

In iOS, Heimdall serves as a gatekeeper between Security framework and the UI, offering a nice wrapper around the C APIs for encrypting, decrypting, signing and verifying messages.

Furthermore, Heimdall also helps maintain the public-private RSA key-pair in Keychain, allowing both creating as well as deleting the key pairs.

Requirements

Heimdall requires Swift 3 and works with only Xcode 8 and above

Installation

CocoaPods

Heimdall is available as a CocoaPod, simply add the following line to your Podfile

pod 'Heimdall', '~> 1.1.0'

Also, make sure your podfile includes the following line, which is necessary to support Swift frameworks

use_frameworks!

Carthage

Simply include the following line in your Cartfile

github "henrinormak/Heimdall"

Note that Heimdall produces two frameworks in the Carthage build directory - Heimdall.framework and CommonCrypto.framework, you only need to include/embed Heimdall.framework into your project.

Subproject

As Heimdall makes use of CommonCrypto and has it wrapped in a pseudo-module, the easiest way to use Heimdall is to include the entire project as a subproject in your workspace.

To do this, include Heimdall.xcodeproj (found in Heimdall folder) into your Xcode workspace. Then specify the Heimdall target as a Target Dependency for your main application target.

Target Dependency selection in Xcode

Finally, make sure Heimdall is listed under the Embedded Binaries section in Xcode

Embedded Binaries under application target settings

Directly

Although not recommended, you can also add Heimdall directly, by including Heimdall.swift in your project.

Usage

Using Heimdall is simple, for public-private key-pair, you just have to create an instance, which can be used for encryption/decryption, signing/verifying.

With this method you can locally encrypt data to be stored on disk or in a database, without putting everything in the Keychain.

if let heimdall = Heimdall(tagPrefix: "com.example") {
    let testString = "This is a test string"

    // Encryption/Decryption
    if let encryptedString = heimdall.encrypt(testString) {
        println(encryptedString) // "cQzaQCQLhAWqkDyPoHnPrpsVh..."

        if let decryptedString = heimdall.decrypt(encryptedString) {
            println(decryptedString) // "This is a test string"
        }
    }

    // Signatures/Verification
    if let signature = heimdall.sign(testString) {
        println(signature) // "fMVOFj6SQ7h+cZTEXZxkpgaDsMrki..."
        var verified = heimdall.verify(testString, signatureBase64: signature)
        println(verified) // True

        // If someone meddles with the message and the signature becomes invalid
        verified = heimdall.verify(testString + "injected false message",
                                    signatureBase64: signature)
        println(verified) // False
    }
}

Note on encryption/decryption

As RSA imposes a limit on the length of message that can be enrcypted, Heimdall uses a mix of AES and RSA to encrypt messages of arbitrary length. This is done in the following manner:

  1. A random AES key of suitable length is generated, the length is based on the size of the RSA key pair (either 128, 192 or 256 bits) *
  2. The message is encrypted with this AES key
  3. The key is encrypted with the public part of the RSA key pair (and padded to the correct block size) *
  4. The payload is built, containing the encrypted key, followed by the encrypted message. During decryption, the first block is always assumed to be the RSA encrypted AES key, this is why Heimdall can only decrypt messages encrypted by other Heimdall instances (or code that is compatible with Heimdall's logic) *

Complex use case

A more complex use case involves exchanging encrypted messages between multiple Heimdall instances, which can be situated on multiple different hosts.

First step is to share your public key with another party:

let localHeimdall = Heimdall(tagPrefix: "com.example")
if let heimdall = localHeimdall, publicKeyData = heimdall.publicKeyDataX509() {

    var publicKeyString = publicKeyData.base64EncodedString()

    // If you want to make this string URL safe,
    // you have to remember to do the reverse on the other side later
    publicKeyString = publicKeyString.replacingOccurrences(of: "/", with: "_")
    publicKeyString = publicKeyString.replacingOccurrences(of: "+", with: "-")

    println(publicKeyString) // Something along the lines of "MIGfMA0GCSqGSIb3DQEBAQUAA..."

    // Data transmission of public key to the other party
}

Second step, acting as the recipient (the one that wants to send the encrypted message), you receive the public key extracted and create a matching Heimdall instance:

// On other party, assuming keyData contains the received public key data
if let partnerHeimdall = Heimdall(publicTag: "com.example.partner", publicKeyData: keyData) {
    // Transmit some message to the partner
    let message = "This is a secret message to my partner"
    let encryptedMessage = partnerHeimdall.encrypt(message)

    // Transmit the encryptedMessage back to the origin of the public key
}

Finally, having received the encrypted message, the party that sent out the public key can decrypt it using the original Heimdall instance they had:

// Initial host receives encryptedMessage
if let heimdall = localHeimdall {
    if let decryptedMessage = heimdall.decrypt(encryptedMessage) {
        println(decryptedMessage) // "This is a secret message to my partner"
    }
}

The workflow should be mirrored on all hosts, extracting their public keys and sharing those to all other parties. The public keys can be used to construct special Heimdall instances that are only able to encrypt messages and verify signatures.

Contributing and Current Work

Contributions to the codebase are very welcome, for ideas on what is needed, have a look through the open issues. In addition, any suggestions regarding the following topics are welcome:

  • Security, interacting with the Keychain, making sure the results are kept securely etc.
  • Tests, adding tests would also likely increase security
  • Additional configurability, perhaps allowing non-permanent keys
  • Error handling, currently most of the API simply returns nils whenever an error occurs, this should be changed and proper error reporting should be implemented
  • Reducing the number of optionals in the public API of the Heimdall instances.

Contact

If you have any questions, don't hesitate to contact me. In case of bugs, create an issue here on GitHub

Henri Normak

License

The MIT License (MIT)

Copyright (c) 2015 Henri Normak

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Comments
  • Changes for Swift3

    Changes for Swift3

    Most of the changes are created automatically by xcode.. I had fix few issues after that. I ran all the tests successfully. Please make sure to have simulator is set to ios 9.x. It will fail on 10.x because of bug in new simulator.

    opened by rajeevpra 27
  • obtainingKey, SecKeyRef is nil

    obtainingKey, SecKeyRef is nil

    While obtaining key before encyption,

    let status = SecItemCopyMatching(query, &keyRef) status is 0 but keyRef is nil only on iOS9. it works well on iOS8.

    Could you help ?

    Thanks

    bug 
    opened by goksucapar 16
  • XCode 10: redefinition of module 'CommonCrypto'

    XCode 10: redefinition of module 'CommonCrypto'

    I'm trying to run my project with XCode 10 beta, but I get an error saying: redefinition of module 'CommonCrypto'.

    Showing All Messages Failed to emit precompiled header '.../Library/Developer/Xcode/DerivedData/dukzbmbkgxmidoaaqsvrwtawkugp/Build/Intermediates.noindex/PrecompiledHeaders/Bridging-Header-swift_2EL3O7W05IR7C-clang_1MOIT4BKL3MYZ.pch' for bridging header '.../Bridging-Header.h'

    opened by nabbestemmia 11
  • error -9809 when verifying signed string

    error -9809 when verifying signed string

    I am using the below code to sign and verify the signature but getting false always! Digging in further, I found out the error code is -9809 - An underlying cryptographic error was encountered.

    Need help in getting this solved please.

    Below, am pasting my code -

    if let heimdall = Heimdall(tagPrefix: "com.something.myapp") {
                
                let testString = "123456"
                
                if let publicKeyDataX509Value = heimdall.publicKeyDataX509() {
                    NSLog("Heimdall Public Key \(publicKeyDataX509Value.base64EncodedString())")
                }
                
                if let signature = heimdall.sign(testString, urlEncode: true) {
                    NSLog("signature for 123456 \(signature)")
    
                    var verified = heimdall.verify(testString, signatureBase64: signature, urlEncoded: true)
                    NSLog("Verification successful \(verified)") // True
                    
                    // If someone meddles with the message and the signature becomes invalid
                    verified = heimdall.verify(testString + "injected false message",
                                               signatureBase64: signature)
                    NSLog("Verification failed \(verified)") // False
                }
            }
    
    opened by lohithkorp 9
  • Android Compatibility

    Android Compatibility

    Hello there, I'm working on exchanging encrypted data between my iOS and Android apps. Intra-platform communication is working perfectly for both iOS and Android. Now the exchange between iOS and Android is running into a decryption problem on the iOS side using Heimdall. I followed the Heimdall logic while writing the Android app as you can see below, but it seems some encoding or padding discrepancies caused the problem. Could any of the mentioned have caused the problem?

    String stringToShare = "Test String to Share";
            String userPublicKi = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1dOgSE2sPXDaHurcDygJsZojtA4HX3kV+2Msc0HpImSLpza5pJ5nz957Zp2XRprxImatAEx6kkKjII8PBKXyu74jEHqFP9ObzkDc/ZzhVk8/2xEUkAGokozM7SLp9US4lULJ0pXA1/MuVpZ20cGngJDYWVotSg90LbHAjVewVk497qLf9nK/UxoYzMpqWmPDjUCRQeNQVaMglSrRLTXcbWYlzm+MLlvbopagtF43nERlQ4e7xQRSS5k5EkeXOzOGCXNWMK/jTM3+cCIL2lGjWUWjMEZCIymv9nFBgeSPcDHiCjcWy25GfEJq6E5U4ke5YwLaYhxjWHXuVcdkefkTPwIDAQAB";
    
    KeyGenerator keyGen = null;
            try {
    
                // Generate AES Random secret key
                keyGen = KeyGenerator.getInstance("AES");
                keyGen.init(256);
                SecretKeySpec secretKey = new SecretKeySpec(keyGen.generateKey().getEncoded(), "AES");
    
                // Get UTF8 encoded data from string to encrypt
                byte[] encodedData = serializedUserAccountToShare.getBytes("UTF-8");
    
                byte[] encryptedMessage = encryptAES(secretKey, encodedData);
    
                byte[] encryptedKey = encryptStringWithKey(new String(secretKey.getEncoded(), "UTF-8"), userPublicKi);
    
                ByteArrayOutputStream outputStream = new ByteArrayOutputStream( );
                outputStream.write(encryptedKey);
                outputStream.write(encryptedMessage);
                // Final result to send
                byte dump[] = outputStream.toByteArray();
                // Testing part of the decryption on the Android side
                String decrypted = new String(decryptAES(secretKey.getEncoded(), encryptedMessage));
    

    and the functions I used in the process:

    // AES
        private static byte[] encryptAES(SecretKeySpec raw, byte[] clear) throws Exception {
    //        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
            Cipher cipher = Cipher.getInstance("AES");
            cipher.init(Cipher.ENCRYPT_MODE, raw);
            byte[] encrypted = cipher.doFinal(clear);
            return encrypted;
        }
    
    public static PublicKey getKey(String key){
            try{
                byte[] byteKey = Base64.decode(key.getBytes(), Base64.DEFAULT);
                X509EncodedKeySpec X509publicKey = new X509EncodedKeySpec(byteKey);
                KeyFactory kf = KeyFactory.getInstance("RSA");
    
                return kf.generatePublic(X509publicKey);
            }
            catch(Exception e){
                e.printStackTrace();
            }
    
            return null;
        }
    
         // RSA
        public byte[] encryptStringWithKey(String text, String key) {
            try {
                // Encrypt the text
                String initialText = text;
                if (initialText.isEmpty()) {
                    Toast.makeText(this, "String to encrypt is empty", Toast.LENGTH_LONG).show();
                    return new byte[0];
                }
    
                Cipher input = Cipher.getInstance("RSA/ECB/PKCS1Padding");
                input.init(Cipher.ENCRYPT_MODE, getKey(key));
    
                ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                CipherOutputStream cipherOutputStream = new CipherOutputStream(
                        outputStream, input);
                cipherOutputStream.write(initialText.getBytes("UTF-8"));
                cipherOutputStream.close();
    
                byte[] vals = outputStream.toByteArray();
                outputStream.close();
                return vals;
            } catch (Exception e) {
                Log.e("Exception", Log.getStackTraceString(e));
            }
            return new byte[0];
        }
    

    Thank you.

    opened by JuniorSfeir 8
  • Improve AES encryption logic

    Improve AES encryption logic

    Two big changes, making sure initialisation vector is not null, indeed using random bytes that are stored along with the encrypted AES key.

    Second, make sure the AES key size is determined correctly, also leaving room for the included IV in the first block.

    opened by henrinormak 7
  • intermittent failure decrypting... (???)

    intermittent failure decrypting... (???)

    Not really sure how to perfectly describe my problem =(. I am using the latest version available via cocoapods and latest Swift. I am encrypting both text, e.g. String = "foo" and also images after base64 encoding them e.g. let _imageData = UIImageJPEGRepresentation(image, compressionFactor) let _encodedString = _imageData!.base64EncodedStringWithOptions(NSDataBase64EncodingOptions())

    I use a 2048 size key e.g. Heimdall(tagPrefix: key, keySize: 2048) and when I encrypt and decrypt I use urlEncode: false since the data is stored in a back end that doesn't need url encoding. I decrypt simply by: if let clearText = my_Heimdall_instance.decrypt(encrypted_text, urlEncoded: false) as String? { ...} So far so good. It's a chat application. it works great! except every now and again, seemingly without any pattern, decryption fails and returns nil. It's almost random and happens once every 20 to 100 messages. Sometimes with plain text messages, sometimes with images. I suspect some weird boundary condition (padding?) but I can't figure it out! The encrypted content looks normal and the length seems reasonable

    Any ideas?? [there may be a small reward for the first person to solve it!]

    Thanks! =)

    ps: FWIW, here is an example of an encrypted message that failed to decrypt. It's a few simple words as a String: jNCNYe8NPgqs3jspfGGiOwa/AkRb5PBWSp0FFvVdvMrMU50/0ti8j4SpYF+/OlcaeorpItuqEymU/mNB9PhHaV7IhxTPk8STcEs0o8KynHq1l7bHQ6gkHCMwhTxgNBeB+Mvctv5Pxxxg3+ESUmCKMH4G9+skC63Mamcm5BIRqokoL3lxnHaz77j0N09jP0rAkBY0jwN0myGrp2JV1cqLzzkWkTOYFkzgReMqRgrf3c2c9/vrRCPLk9umGGFq/YfCZXfpFja6C3OwPulgoKFxu/qX2hYAUZdJrZ0ao1/bL+xkSLvnOw/dXaR3FAxggFhzvbb/7+AVbnW3clvOF2gzLN05igEB6vxQuX0rQ9QLRop5hgR157LepY+EJtwBnSocPeYJ94MqoV0IeuFuevhuOXycAcyGwTHosdQX4pl7JzRs1oZR7wLJJgV4UDYF/uVXhp3X744+doefZsOvMnjddA==

    opened by hools 6
  • Encryption issue in V1.0.0

    Encryption issue in V1.0.0

    Hi,

    I use V0.3.0 which can encrypt the text by following code successfully

    localHeimdall = Heimdall(tagPrefix: "com.test", keySize: 512)
    let encryptedMessage = localHeimdall.encrypt("123")
    

    but the result become nil after I upgrade to V1.0.0

    I tried to set a breakpoint in public func encrypt(data: NSData) -> NSData? in"Heimdall.swift", I notice that the status is -50 and will return nil in

    if status != noErr {
                        return nil
                    }
    

    Could you please help?

    opened by sjacs5537 5
  • Generate RSA using Modulus and Exponent

    Generate RSA using Modulus and Exponent

    Hi, I need to create an RSA Key providing a modulus and an exponent. Not sure if that is currently possible using Heimdall. I'll be glad with help of any kind! Thanks

    opened by kosicki123 5
  • Not swift 3 ready?

    Not swift 3 ready?

    I used pod to add your module to an app I am testing, but after I got it installed using pod, I received several (110) errors in my app. All seems to be because of swift 3 which I am using in my app.

    Heimdall Group Swift Compiler Error Group /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:59:73: Expected ',' joining parts of a multi-clause condition /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:64:74: Expected 'let' in conditional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:151:50: Expected 'let' in conditional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:177:100: Expected 'let' in conditional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:222:68: Expected 'let' in conditional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:223:17: Expected 'let' in conditional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:269:111: Expected 'let' in conditional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:341:100: Expected 'let' in conditional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:365:43: Expected 'let' in conditional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:412:101: Expected 'let' in conditional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:429:42: Expected 'let' in conditional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:462:49: Expected ',' joining parts of a multi-clause condition /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:490:45: Expected ',' joining parts of a multi-clause condition /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:533:45: Expected ',' joining parts of a multi-clause condition /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:543:45: Expected ',' joining parts of a multi-clause condition /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:650:47: Expected 'let' in conditional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:777:40: 'inout' before a parameter name is not allowed, place it before the parameter type instead /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:815:44: Expected ',' joining parts of a multi-clause condition /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:151:40: Missing argument label 'key:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:177:30: 'dataUsingEncoding(:allowLossyConversion:)' has been renamed to 'data(usingEncoding:allowLossyConversion:)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Foundation.String:21:17: 'dataUsingEncoding(:allowLossyConversion:)' has been explicitly marked unavailable here /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:177:48: 'NSUTF8StringEncoding' has been renamed to 'String.Encoding.utf8' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Foundation.NSUTF8StringEncoding:2:12: 'NSUTF8StringEncoding' has been explicitly marked unavailable here /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:177:117: Argument labels '(:)' do not match any available overloads /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:177:117: Overloads for 'encrypt' exist with these partially matching parameter lists: (string: String, urlEncode: Bool), (data: NSData) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:222:58: Missing argument label 'count:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:269:68: 'NSDataBase64DecodingOptions' has been renamed to 'NSData.Base64DecodingOptions' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:269:68: 'NSDataBase64DecodingOptions' was obsoleted in Swift 3 /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:341:30: 'dataUsingEncoding(:allowLossyConversion:)' has been renamed to 'data(usingEncoding:allowLossyConversion:)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Foundation.String:21:17: 'dataUsingEncoding(:allowLossyConversion:)' has been explicitly marked unavailable here /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:341:48: 'NSUTF8StringEncoding' has been renamed to 'String.Encoding.utf8' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Foundation.NSUTF8StringEncoding:2:12: 'NSUTF8StringEncoding' has been explicitly marked unavailable here /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:341:121: Argument labels '(:)' do not match any available overloads /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:341:121: Overloads for 'sign' exist with these partially matching parameter lists: (string: String, urlEncode: Bool), (data: NSData) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:412:31: 'dataUsingEncoding(:allowLossyConversion:)' has been renamed to 'data(usingEncoding:allowLossyConversion:)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Foundation.String:21:17: 'dataUsingEncoding(:allowLossyConversion:)' has been explicitly marked unavailable here /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:412:49: 'NSUTF8StringEncoding' has been renamed to 'String.Encoding.utf8' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Foundation.NSUTF8StringEncoding:2:12: 'NSUTF8StringEncoding' has been explicitly marked unavailable here /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:412:158: 'NSDataBase64DecodingOptions' has been renamed to 'NSData.Base64DecodingOptions' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:412:158: 'NSDataBase64DecodingOptions' was obsoleted in Swift 3 /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:462:74: Missing argument label 'tag:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:533:81: Binary operator '&' cannot be applied to two 'Heimdall.ScopeOptions' operands /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:533:81: Overloads for '&' exist with these partially matching parameter lists: (UInt8, UInt8), (Int8, Int8), (UInt16, UInt16), (Int16, Int16), (UInt32, UInt32), (Int32, Int32), (UInt64, UInt64), (Int64, Int64), (UInt, UInt), (Int, Int) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:543:81: Binary operator '&' cannot be applied to two 'Heimdall.ScopeOptions' operands /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:543:81: Overloads for '&' exist with these partially matching parameter lists: (UInt8, UInt8), (Int8, Int8), (UInt16, UInt16), (Int16, Int16), (UInt32, UInt32), (Int32, Int32), (UInt64, UInt64), (Int64, Int64), (UInt, UInt), (Int, Int) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:57:54: Missing argument label 'tag:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:60:35: Missing argument label 'tag:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:140:40: Missing argument label 'key:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:162:30: Missing argument label 'key:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:207:45: Missing argument label 'algorithm:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:265:22: Value of type 'String' has no member 'stringByReplacingOccurrencesOfString' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:266:22: Value of type 'String' has no member 'stringByReplacingOccurrencesOfString' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:288:45: Missing argument label 'algorithm:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:368:57: Cannot invoke initializer for type 'UnsafeMutablePointer<>' with an argument list of type '(UnsafeMutableRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:368:57: Pointer conversion restricted: use '.assumingMemoryBound(to:)' or '.bindMemory(to:capacity:)' to view memory as a type. /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:368:57: Overloads for 'UnsafeMutablePointer<>' exist with these partially matching parameter lists: (RawPointer), (OpaquePointer), (OpaquePointer?), (UnsafeMutablePointer), (UnsafeMutablePointer?) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:374:28: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:374:28: Pointer conversion restricted: use '.assumingMemoryBound(to:)' or '.bindMemory(to:capacity:)' to view memory as a type. /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:374:28: Overloads for 'UnsafePointer' exist with these partially matching parameter lists: (RawPointer), (OpaquePointer), (OpaquePointer?), (UnsafePointer), (UnsafePointer?), (UnsafeMutablePointer), (UnsafeMutablePointer?) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:408:22: Value of type 'String' has no member 'stringByReplacingOccurrencesOfString' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:409:22: Value of type 'String' has no member 'stringByReplacingOccurrencesOfString' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:430:57: Cannot invoke initializer for type 'UnsafeMutablePointer<>' with an argument list of type '(UnsafeMutableRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:430:57: Pointer conversion restricted: use '.assumingMemoryBound(to:)' or '.bindMemory(to:capacity:)' to view memory as a type. /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:430:57: Overloads for 'UnsafeMutablePointer<>' exist with these partially matching parameter lists: (RawPointer), (OpaquePointer), (OpaquePointer?), (UnsafeMutablePointer), (UnsafeMutablePointer?) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:432:30: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:432:30: Pointer conversion restricted: use '.assumingMemoryBound(to:)' or '.bindMemory(to:capacity:)' to view memory as a type. /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:432:30: Overloads for 'UnsafePointer' exist with these partially matching parameter lists: (RawPointer), (OpaquePointer), (OpaquePointer?), (UnsafePointer), (UnsafePointer?), (UnsafeMutablePointer), (UnsafeMutablePointer?) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:434:33: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:434:33: Pointer conversion restricted: use '.assumingMemoryBound(to:)' or '.bindMemory(to:capacity:)' to view memory as a type. /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:434:33: Overloads for 'UnsafePointer' exist with these partially matching parameter lists: (RawPointer), (OpaquePointer), (OpaquePointer?), (UnsafePointer), (UnsafePointer?), (UnsafeMutablePointer), (UnsafeMutablePointer?) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:459:31: Missing argument label 'tag:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:460:54: Unary operator '~' cannot be applied to an operand of type 'Heimdall.ScopeOptions' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:460:54: Overloads for '~' exist with these partially matching parameter lists: (UInt8), (Int8), (UInt16), (Int16), (UInt32), (Int32), (UInt64), (Int64), (UInt), (Int) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:463:58: Unary operator '~' cannot be applied to an operand of type 'Heimdall.ScopeOptions' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:463:58: Overloads for '~' exist with these partially matching parameter lists: (UInt8), (Int8), (UInt16), (Int16), (UInt32), (Int32), (UInt64), (Int64), (UInt), (Int) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:486:23: Binary operator '&' cannot be applied to two 'Heimdall.ScopeOptions' operands /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:486:23: Overloads for '&' exist with these partially matching parameter lists: (UInt8, UInt8), (Int8, Int8), (UInt16, UInt16), (Int16, Int16), (UInt32, UInt32), (Int32, Int32), (UInt64, UInt64), (Int64, Int64), (UInt, UInt), (Int, Int) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:509:34: 'OptionSetType' has been renamed to 'OptionSet' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:509:34: 'OptionSetType' has been explicitly marked unavailable here (Swift.OptionSetType) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:530:45: 'SecKeyRef' has been renamed to 'SecKey' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:531:41: Binary operator '&' cannot be applied to two 'Heimdall.ScopeOptions' operands /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:531:41: Overloads for '&' exist with these partially matching parameter lists: (UInt8, UInt8), (Int8, Int8), (UInt16, UInt16), (Int16, Int16), (UInt32, UInt32), (Int32, Int32), (UInt64, UInt64), (Int64, Int64), (UInt, UInt), (Int, Int) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:541:41: Binary operator '&' cannot be applied to two 'Heimdall.ScopeOptions' operands /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:541:41: Overloads for '&' exist with these partially matching parameter lists: (UInt8, UInt8), (Int8, Int8), (UInt16, UInt16), (Int16, Int16), (UInt32, UInt32), (Int32, Int32), (UInt64, UInt64), (Int64, Int64), (UInt, UInt), (Int, Int) /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:542:43: Missing argument label 'tag:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:544:43: Missing argument label 'tag:' in call /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:554:50: 'SecKeyRef' has been renamed to 'SecKey' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:559:48: 'CFStringRef' has been renamed to 'CFString' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:563:42: Cannot convert value of type 'Dictionary<String, AnyObject>' to expected argument type 'CFDictionary' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:582:48: 'CFStringRef' has been renamed to 'CFString' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:588:36: Cannot convert value of type 'Dictionary<String, AnyObject>' to expected argument type 'CFDictionary' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:601:48: 'CFStringRef' has been renamed to 'CFString' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:604:30: Cannot convert value of type 'Dictionary<String, AnyObject>' to expected argument type 'CFDictionary' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:610:48: 'CFStringRef' has been renamed to 'CFString' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:613:30: Cannot convert value of type 'Dictionary<String, AnyObject>' to expected argument type 'CFDictionary' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:616:76: 'SecKeyRef' has been renamed to 'SecKey' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:619:63: 'CFStringRef' has been renamed to 'CFString' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:620:73: 'CFStringRef' has been renamed to 'CFString' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:621:59: 'CFDataRef' has been renamed to 'CFData' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:622:69: 'CFBooleanRef' has been renamed to 'CFBoolean' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:625:33: Cannot convert value of type 'Dictionary<String, AnyObject>' to expected argument type 'CFDictionary' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:635:108: 'SecKeyRef' has been renamed to 'SecKey' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:636:33: Heterogeneous collection literal could only be inferred to '[String : Any]'; add explicit type annotation if this is intentional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:638:32: Heterogeneous collection literal could only be inferred to '[String : Any]'; add explicit type annotation if this is intentional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:641:30: Heterogeneous collection literal could only be inferred to '[String : Any]'; add explicit type annotation if this is intentional /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:648:35: Cannot convert value of type '[String : Any]' to expected argument type 'CFDictionary' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:661:44: Argument 'repeatedValue' must precede argument 'count' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:688:25: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:692:27: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:694:26: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:696:33: Cannot invoke initializer for type 'UnsafeMutablePointer' with an argument list of type '(UnsafeMutableRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:713:29: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:717:27: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:719:26: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:721:33: Cannot invoke initializer for type 'UnsafeMutablePointer' with an argument list of type '(UnsafeMutableRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:742:59: 'ScopeOptions' is inaccessible due to 'private' protection level /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:746:62: 'ScopeOptions' is inaccessible due to 'private' protection level /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:750:84: 'ScopeOptions' is inaccessible due to 'private' protection level /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:770:26: Incorrect argument label in call (have ':atIndex:', expected ':at:') /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:784:57: Ambiguous use of operator '-' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:811:86: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:812:87: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:833:14: 'appendBytes(:length:)' has been renamed to 'append(:length:)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:834:26: Incorrect argument label in call (have 'keepCapacity:', expected 'keepingCapacity:') /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:839:14: 'appendBytes(:length:)' has been renamed to 'append(:length:)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:840:26: Incorrect argument label in call (have 'keepCapacity:', expected 'keepingCapacity:') /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:846:14: 'appendBytes(:length:)' has been renamed to 'append(:length:)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:849:25: 'NSMutableData' is not implicitly convertible to 'Data'; did you mean to use 'as' to explicitly convert? /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:854:23: Cannot invoke initializer for type 'UnsafePointer' with an argument list of type '(UnsafeRawPointer)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:909:17: 'appendContentsOf' has been renamed to 'append(contentsOf:)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:910:16: 'appendBytes(:length:)' has been renamed to 'append(:length:)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:911:16: 'appendBytes(:length:)' has been renamed to 'append(:length:)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:912:26: Incorrect argument label in call (have 'keepCapacity:', expected 'keepingCapacity:') /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:915:17: 'appendContentsOf' has been renamed to 'append(contentsOf:)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:917:16: 'appendBytes(:length:)' has been renamed to 'append(:length:)' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:920:27: 'NSData' is not implicitly convertible to 'Data'; did you mean to use 'as' to explicitly convert? /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:926:57: Argument 'repeatedValue' must precede argument 'count' /Users/ssaguiar/work/IosWorkspace/ipTv3/Pods/Heimdall/Heimdall/Heimdall.swift:969:21: 'subdataWithRange' has been renamed to 'subdata(with:)'

    opened by ssaguiar 4
  • Use the same PEM files for every Heimdall instance

    Use the same PEM files for every Heimdall instance

    Good day Henri,

    Thank you for responding to my tweet! I am trying to use the same PEM keys for every instance of Heimdall that I create. All I need to do is encrypt a timestamp with the PRIVATE key to make a simple signature. I haver the PEM of the Public key as well if I need it. I do not mind having to re-make the keys, but I definitely need the private key in a PEM format for the Android version (so if I generate a new key in a new format, I will need to make sure I can convert the new key to a PEM format as well).

    Could you please give me an example where the SAME key (preferably a set of PEM keys) are ALWAYS used in Heimdall and result in the same encrypted string? When I do the following:

        if let heimdall = Heimdall(tagPrefix: "www.example.com"){
            if let encryptedString = heimdall.encrypt("test") {
                print("Encrption: [\(encryptedString)]")
            } else {
                print("Encryption error")
            }
        } else {
            print("Init error")
        }
    

    I get a different String every time. I have tried putting the PEM Strings in as parameters:

        if let heim = Heimdall(publicTag: "...", privateTag: "...")
    

    but I get the same result - different Strings every time I run it.

    enhancement help wanted 
    opened by qbalsdon 4
  • could not find module 'Heimdall' for target 'arm64-apple-ios'; found: x86_64

    could not find module 'Heimdall' for target 'arm64-apple-ios'; found: x86_64

    Hi, I was using Heimdall framework. In Xcode 10 it was working fine.but with the latest Xcode version 12.2 it is showing error : ":0: error: could not find module 'Heimdall' for target 'arm64-apple-ios'; found: x86_64 "

    Please look on this I am blocked here, as this is the deepened framework for our project.

    opened by diveshSinghjbp 0
  • Heimdall fails to decrypt it's own data after upgrading to Xcode 11/iOS 13 SDK

    Heimdall fails to decrypt it's own data after upgrading to Xcode 11/iOS 13 SDK

    The problem is simple but I'm having trouble reproducing it in a standalone project so I'm wondering if you have any ideas off the top of your head. I have a project that was previously building with Xcode 10.1 and used Heimdall to encrypt and decrypt data. After upgrading to Xcode 11, encryption still works but decryption does not. Or perhaps encryption reports a success but actually generates malformed data.

    Here is what I'm doing in my app. I have no idea why this works fine in a minimal example project but fails in my app. Maybe you've encountered similar when building with Xcode 11? Thanks in advance!

    let hd = Heimdall(publicTag: "pubTag", privateTag: "privTag")!
    let encrypted = hd.encrypt("hello")!
    let decrypted = hd.decrypt(encrypted)! // crash - decrypted string is nil
    

    Just to provide some more info. The input String is 5 bytes, but the Data returned from the internal call to self.decrypt is 16 bytes for some reason, and not a valid UTF-8 String which is why the method ultimately returns nil.

    opened by patgoley 4
  • Add support for keychain access groups

    Add support for keychain access groups

    This PR adds support for keychain access group as a parameter when initializing an instance. This is most usable when using Heimdall with app extensions, for example: if one would have a messaging client where push notifications are bundled with data which is encrypted according to a key generated and saved by the "main app", an app extension could be used to decrypt the data using the same key before presenting the push notification.

    opened by rundfunk47 0
  • Access option for RSA keypair in Keychain

    Access option for RSA keypair in Keychain

    Slightly refactored PR from #43. @colinmorelli, if possible, please review this. My main concern is the fact that the access flag can not be changed once set without regenerating the key. If this is a problem, then it needs to be addressed (for example, someone wanting to change the access as part of some switch in the app, without revoking the keypair).

    opened by henrinormak 0
Releases(2.0.1)
Owner
Henri Normak
Apple fan, iOS developer at heart, a "let's get it done" type of engineer.
Henri Normak
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.

PhoneNumberKit Swift 5.3 framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber. Features F

Roy Marmelstein 4.7k Jan 8, 2023
OysterKit is a framework that provides a native Swift scanning, lexical analysis, and parsing capabilities. In addition it provides a language that can be used to rapidly define the rules used by OysterKit called STLR

OysterKit A Swift Framework for Tokenizing, Parsing, and Interpreting Languages OysterKit enables native Swift scanning, lexical analysis, and parsing

Swift Studies 178 Sep 16, 2022
The iOS framework that grows only as fast as its documentation

Nimbus is an iOS framework whose feature set grows only as fast as its documentation. Support status Nimbus is in a supported maintenance mode, meanin

featherless 6.5k Nov 30, 2022
An Objective-C framework for converting Markdown to HTML.

MMMarkdown MMMarkdown is an Objective-C framework for converting Markdown to HTML. It is compatible with OS X 10.7+, iOS 8.0+, tvOS, and watchOS. Unli

Matt Diephouse 1.2k Dec 14, 2022
Powerful text framework for iOS to display and edit rich text.

YYText Powerful text framework for iOS to display and edit rich text. (It's a component of YYKit) Features UILabel and UITextView API compatible High

null 8.8k Jan 4, 2023
A Swift framework for using custom emoji in strings.

Emojica – a Swift framework for using custom emoji in strings. What does it do? Emojica allows you to replace the standard emoji in your iOS apps with

Dan 101 Nov 7, 2022
A simple and customizable Markdown Parser for Swift

MarkdownKit MarkdownKit is a customizable and extensible Markdown parser for iOS and macOS. It supports many of the standard Markdown elements through

Bruno Oliveira 687 Dec 18, 2022
RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing.

RichEditorView RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing. Written in Swift 4 Supports iOS 8+ through Cocoapod

Caesar Wirth 1.8k Dec 24, 2022
A simple library for building attributed strings, for a more civilized age.

Veneer A simple library for building attributed strings, for a more civilized age. Veneer was created to make creating attributed strings easier to re

Wess Cope 26 Dec 27, 2022
Swift String Validator. Simple lib for ios to validate string and UITextFields text for some criterias

Swift String validator About Library for easy and fastest string validation based on сciterias. Instalation KKStringValidator is available through Coc

Kostya 17 Dec 21, 2019
A simple library that provides standard Unicode emoji support across all platforms

Twitter Emoji (Twemoji) A simple library that provides standard Unicode emoji support across all platforms. Twemoji v13.1 adheres to the Unicode 13.0

Twitter 15k Jan 8, 2023
A simple Cron Parser with Swift

A simplified cron parser Requirements Swift 5.5 Command line tools How to Run Cr

null 0 Dec 21, 2021
Simple, keyboard-first, markdown note-taking for MacOS

QuickDown Simple, keyboard-first, markdown note-taking for MacOS Main Features Global Hotkey: ⌘-⌥-N Save Note: ⌘-S Launch on Login (Optional) Addition

Alexis Rondeau 50 Nov 29, 2022
GRE3000 - Simple GRE 3000 words app for Chinese

GRE3000 Simple GRE 3000 words app for Chinese Usage Tap Left half Screen for pre

Changhao Song 0 Mar 16, 2022
_Text is a simple augmentation to SwiftUI that makes styling easier

_Text _Text is a simple augmentation to SwiftUI that makes styling easier. By utilizing the environment it is possible to apply text modifiers to any

Eric Lewis 1 Feb 22, 2022
RSA public/private key generation, RSA, AES encryption/decryption, RSA sign/verify in Swift with CommonCrypto in iOS and OS X

SwCrypt Create public and private RSA keys in DER format let (privateKey, publicKey) = try! CC.RSA.generateKeyPair(2048) Convert them to PEM format l

soyer 695 Dec 8, 2022
The app encrypts or decrypts user's text input with basic encryption and decryption algorithms

Objective-C Wrapper Project About The Project The app encrypts or decrypts user's text input with basic encryption and decryption algorithms. Purpose

Can Yoldas 0 Dec 5, 2021
Encryption/Decryption for React Native

@dhairyasharma/react-native-encryption Encryption/decryption for React Native. Benchmark File Details File Link http://bit.do/benchmarkfile File Size

Dhairya Sharma 5 Sep 13, 2022
Encryption/Decryption for React Native

@dhairyasharma/react-native-encryption Encryption/decryption for React Native. Benchmark File Details File Link http://bit.do/benchmarkfile File Size

Dhairya Sharma 5 Sep 13, 2022
DataKernel is a minimalistic wrapper around CoreData stack to ease persistence operations.

DataKernel What is DataKernel? DataKernel is a minimalistic wrapper around CoreData stack to ease persistence operations. It is heavily inspired by Su

Denis 16 Jun 2, 2022