{"id":23378852,"url":"https://github.com/joeymeyer/pbkdf2-wrapper","last_synced_at":"2025-04-10T20:45:01.524Z","repository":{"id":16275122,"uuid":"19023481","full_name":"joeymeyer/PBKDF2-Wrapper","owner":"joeymeyer","description":"An Objective-C interface for the PBKDF2 implementation in CommonCrypto.","archived":false,"fork":false,"pushed_at":"2016-09-28T14:43:01.000Z","size":97,"stargazers_count":32,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-22T10:05:35.115Z","etag":null,"topics":["commoncrypto","ios","macos","objective-c","pbkdf2","watchos"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joeymeyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-22T09:07:47.000Z","updated_at":"2024-01-29T05:53:57.000Z","dependencies_parsed_at":"2022-09-14T11:41:32.538Z","dependency_job_id":null,"html_url":"https://github.com/joeymeyer/PBKDF2-Wrapper","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeymeyer%2FPBKDF2-Wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeymeyer%2FPBKDF2-Wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeymeyer%2FPBKDF2-Wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeymeyer%2FPBKDF2-Wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeymeyer","download_url":"https://codeload.github.com/joeymeyer/PBKDF2-Wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248294617,"owners_count":21079936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commoncrypto","ios","macos","objective-c","pbkdf2","watchos"],"created_at":"2024-12-21T19:14:52.874Z","updated_at":"2025-04-10T20:45:01.497Z","avatar_url":"https://github.com/joeymeyer.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PBKDF2-Wrapper\n\n[![Version](https://img.shields.io/cocoapods/v/PBKDF2-Wrapper.svg?style=flat)](http://cocoadocs.org/docsets/PBKDF2-Wrapper)\n[![Platform](https://img.shields.io/cocoapods/p/PBKDF2-Wrapper.svg?style=flat)](http://cocoadocs.org/docsets/PBKDF2-Wrapper)\n[![License](https://img.shields.io/cocoapods/l/PBKDF2-Wrapper.svg?style=flat)](http://cocoadocs.org/docsets/PBKDF2-Wrapper)\n\nPBKDF2-Wrapper provides a very simple Objective-C interface for the [CommonCrypto](https://developer.apple.com/library/mac/documentation/security/conceptual/cryptoservices/GeneralPurposeCrypto/GeneralPurposeCrypto.html#//apple_ref/doc/uid/TP40011172-CH9-SW1) implementation of the [PBKDF2](http://blog.agilebits.com/2011/05/05/defending-against-crackers-peanut-butter-keeps-dogs-friendly-too/) algorithm.\n\n## Usage\n\n#### Derive Key\nDerive an encryption key from a password. `PBKDF2Result` automatically handles creating a secure random salt, and calibrating the number of rounds to take approximately 100ms to derive the key.\n\n```objective-c\nNSString *password = ...;\nPBKDF2Result *result = [[PBKDF2Result alloc] initWithPassword:password];\nNSData *encryptionKey = result.derivedKey;\n```\n\n#### Save Configuration\nAfterwards you can conveniently archive the configuration which includes information such the key length, salt, number of rounds, and the pseudo random function that was used when deriving the key.\n\n```objective-c\n[NSKeyedArchiver archiveRootObject:result.configuration\n                            toFile:@\"/path/to/file\"];\n```\n\n#### Load Saved Configuration\nNext launch you can grab the archived configuration file and use that when deriving the key.\n\n```objective-c\nPBKDF2Configuration *configuration = [NSKeyedUnarchiver unarchiveObjectWithFile:@\"/path/to/file\"];\n\nNSString *password = ...;\nPBKDF2Result *result = [[PBKDF2Result alloc] initWithPassword:password\n                                                configuration:configuration];\nNSData *encryptionKey = result.derivedKey;\n```\n\n#### Explicit Configuration Creation\nIn addition you can also explicitly create the configuration using a number of helpful initializers. Here is an example:\n\n```objective-c\nNSData *salt = ...;\n\n[[PBKDF2Configuration alloc] initWithSalt:salt\n                         derivedKeyLength:16\n                                   rounds:20000\n                     pseudoRandomFunction:PBKDF2PseudoRandomFunctionSHA256];\n```\n\n## Installation\n\n1. Install via [CocoaPods](http://cocoapods.org/)\n\t\n  ```ruby\n  pod 'PBKDF2-Wrapper'\n  ```\n\n2. Import the public header\n\n  ```objective-c\n  #import \u003cPBKDF2-Wrapper/PBKDF2-Wrapper.h\u003e\n  ```\n\n##Requirements\n\n- iOS 6.0\n- OSX 10.8\n- watchOS 2.0\n\n## Tests\n\n[![Build Status](https://travis-ci.org/joeymeyer/PBKDF2-Wrapper.svg?branch=master)](https://travis-ci.org/joeymeyer/PBKDF2-Wrapper)\n\nTo run tests pull down the repository and run the following commands:\n\n```bash\n$ bundle install\n$ bundle exec rake test:prepare\n$ bundle exec rake\n```\n\n## Creator\n\n[Joey Meyer](http://www.joeymeyer.com)\n\n## License\n\nPBKDF2-Wrapper is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeymeyer%2Fpbkdf2-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeymeyer%2Fpbkdf2-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeymeyer%2Fpbkdf2-wrapper/lists"}