{"id":23174369,"url":"https://github.com/dracoon/dracoon-swift-crypto-sdk","last_synced_at":"2026-02-09T15:04:35.196Z","repository":{"id":56907795,"uuid":"128068506","full_name":"dracoon/dracoon-swift-crypto-sdk","owner":"dracoon","description":"Official DRACOON Crypto SDK for Swift","archived":false,"fork":false,"pushed_at":"2025-01-07T12:47:25.000Z","size":97616,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-11T10:17:46.639Z","etag":null,"topics":["crypto","cryptography","dracoon","sdk","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dracoon.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":"Supporting Files/Info.plist","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-04T13:47:25.000Z","updated_at":"2025-01-07T12:42:22.000Z","dependencies_parsed_at":"2024-06-06T07:17:52.719Z","dependency_job_id":null,"html_url":"https://github.com/dracoon/dracoon-swift-crypto-sdk","commit_stats":{"total_commits":94,"total_committers":1,"mean_commits":94.0,"dds":0.0,"last_synced_commit":"c3473f936154a22feb12c3e83ed104e62fd2480a"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/dracoon/dracoon-swift-crypto-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dracoon%2Fdracoon-swift-crypto-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dracoon%2Fdracoon-swift-crypto-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dracoon%2Fdracoon-swift-crypto-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dracoon%2Fdracoon-swift-crypto-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dracoon","download_url":"https://codeload.github.com/dracoon/dracoon-swift-crypto-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dracoon%2Fdracoon-swift-crypto-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260119321,"owners_count":22961508,"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":["crypto","cryptography","dracoon","sdk","swift"],"created_at":"2024-12-18T05:19:59.586Z","updated_at":"2026-02-09T15:04:30.159Z","avatar_url":"https://github.com/dracoon.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DRACOON Swift Crypto SDK\n\nA library which implements the client-side encryption of DRACOON.\n\n# Introduction\n\nA detailed description of client-side encryption of DRACOON can be found here:\n\nhttps://support.dracoon.com/hc/en-us/articles/360000986345\n\n# Setup\n\n#### Swift Package Manager\n\nAdd this line to the dependencies section of your Package.swift:\n\n`.package(url: \"https://github.com/dracoon/dracoon-swift-crypto-sdk\", .upToNextMajor(from: \"3.0.0\"))`\n\nIf you need to define the SDK as target dependency add it like this:\n\n```\ntargets: [\n        ...\n        .target(\n            dependencies: [\n                .product(name: \"crypto_sdk\", package: \"dracoon-swift-crypto-sdk\")\n                ]\n                ...\n            )\n        ]\n```\n\n#### Carthage\n\nAdd the SDK to your Cartfile:\n\n`github \"dracoon/dracoon-swift-crypto-sdk.git\" ~\u003e 3.0.0`\n\nThen run\n\n`carthage update --use-xcframeworks --platform iOS`\n\nto create an xcframework.\n\n#### CocoaPods\n\nAdd to your Podfile:\n```\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '15.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\npod 'DRACOON-Crypto-SDK', '~\u003e v3.0.0'\nend\n```\nThen run\n\n`pod install`\n\n# Example\n\nAn example playground can be found here: `Example/CryptoSDK.playground`\n\nThe example shows the complete encryption workflow, i.e. generate user keypair, validate user\nkeypair, generate file key, encrypt file key, and finally encrypt and decrypt a file.\n\n```swift\n    // --- INITIALIZATION ---\n    let crypto = Crypto()\n    // Generate key pair\n    let userKeyPair = try crypto.generateUserKeyPair(password: USER_PASSWORD)\n    // Check key pair\n    if !crypto.checkUserKeyPair(keyPair: userKeyPair, password: USER_PASSWORD) {\n        ...\n    }\n\n    let plainData = plainText.data(using: .utf8)\n\n    ...\n\n    // --- ENCRYPTION ---\n    // Generate plain file key\n    let plainFileKey = try crypto.generateFileKey()\n    // Encrypt blocks\n    let encryptionCipher = try crypto.createEncryptionCipher(fileKey: fileKey)\n    let encData = try encryptionCipher.processBlock(fileData: plainData)\n    try encryptionCipher.doFinal()\n    // Encrypt file key\n    let encryptedKey = try crypto.encryptFileKey(fileKey: plainFileKey, publicKey: userKeyPair.publicKeyContainer)\n\n    ...\n\n    // --- DECRYPTION ---\n    // Decrypt file key\n    let decryptedKey = try crypto.decryptFileKey(fileKey: encryptedKey, privateKey: userKeyPair.privateKeyContainer,\n      USER_PASSWORD)\n    // Decrypt blocks\n    let decryptionCipher = try crypto.createDecryptionCipher(fileKey: fileKey)\n    let decData = try decryptionCipher.processBlock(fileData: encData)\n    try decryptionCipher.doFinal()\n\n    ...\n```\n\n#### Build boringSSL\n\nIf you want to update the crypto library, please adjust and run\n\n`./build-boringssl.sh`\n\nThen copy the content from output dir to the 'OpenSSL' directory.\n\n# Copyright and License\n\nSee [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdracoon%2Fdracoon-swift-crypto-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdracoon%2Fdracoon-swift-crypto-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdracoon%2Fdracoon-swift-crypto-sdk/lists"}