Unable to obtain ASCII hash utilizing RNCryptor.key

12 views
Skip to first unread message

Dolphin7

unread,
Mar 6, 2018, 9:56:58 AM3/6/18
to rncryptor
Hello,

Utilizing RNCryptor.key with Xcode 9.2., Swift 4, am unable to obtain the ASCII hash utilizing RNCryptor.key with the following example code..

let staticSalt = "com.example.mygreatapp"

        let userSalt = "b...@example.org"

        let salt = (staticSalt + userSalt).data(using: String.Encoding.utf8)

        let kDerivationSettings = RNCryptorKeyDerivationSettings(keySize: 32, saltSize: 8, PBKDFAlgorithm: 2, PRF: 3, rounds: 10000, hasV2Password: false)

        let password = "SomethingTheUserTyped"

        let hash = RNCryptor.key(forPassword: password, salt: salt, settings: kDerivationSettings)

            

       

        

        let hashS = String(data: hash!, encoding: String.Encoding.utf8)


Any help would be greatly appreciated.  

Reply all
Reply to author
Forward
0 new messages