SweetHMAC alternatives and similar libraries
Based on the "Security" category.
Alternatively, view SweetHMAC alternatives based on common mentions on social networks and blogs.
-
CryptoSwift
CryptoSwift is a growing collection of standard and secure cryptographic algorithms implemented in Swift -
KeychainAccess
Simple Swift wrapper for Keychain that works on iOS, watchOS, tvOS and macOS. -
SSKeychain
Simple Objective-C wrapper for the keychain that works on Mac and iOS. -
SAMKeychain
Simple Objective-C wrapper for the keychain that works on Mac and iOS. -
RNCryptor
CCCryptor (AES encryption) wrappers for iOS and Mac in Swift. -- For ObjC, see RNCryptor/RNCryptor-objc -
Valet
Valet lets you securely store data in the iOS, tvOS, or macOS Keychain without knowing a thing about how the Keychain works. Itβs easy. We promise. -
UICKeyChainStore
UICKeyChainStore is a simple wrapper for Keychain on iOS, watchOS, tvOS and macOS. Makes using Keychain APIs as easy as NSUserDefaults. -
Locksmith
A powerful, protocol-oriented library for working with the keychain in Swift. -
SwiftKeychainWrapper
A simple wrapper for the iOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift. -
Themis
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms. -
cocoapods-keys
A key value store for storing per-developer environment and application keys -
SwiftPasscodeLock
An iOS passcode lock with TouchID authentication written in Swift. -
Lockbox
Objective-C utility class for storing data securely in the key chain. -
BiometricAuthentication
Use Apple FaceID or TouchID authentication in your app using BiometricAuthentication. -
SwCrypt
RSA public/private key generation, RSA, AES encryption/decryption, RSA sign/verify in Swift with CommonCrypto in iOS and OS X -
LTHPasscodeViewController
iOS 7 style Passcode Lock -
Obfuscator-iOS
Secure your app by obfuscating all the hard-coded security-sensitive strings. -
TOPasscodeViewController
A modal passcode input and validation view controller for iOS -
SecurePropertyStorage
Helps you define secure storages for your properties using Swift property wrappers. -
SecureEnclaveCrypto
Demonstration library for using the Secure Enclave on iOS -
JOSESwift
A framework for the JOSE standards JWS, JWE, and JWK written in Swift. -
CommonCrypto.swift
:trident: CommonCrypto in Swift, and more -
SipHash
Simple and secure hashing in Swift with the SipHash algorithm -
simple-touch
Very simple swift wrapper for Biometric Authentication Services (Touch ID) on iOS. -
KKPinCodeTextField
A customizable verification code textField. Can be used for phone verification codes, passwords etc -
Virgil Security Objective-C/Swift Crypto Library
Virgil Crypto stack Objective-C/Swift -
iOS-App-Security-Class
Simple class to check if app has been cracked, being debugged or enriched with custom dylib -
Keychain
:key: A keychain wrapper that is so easy to use that your cat could use it. -
Virgil Security Objective-C/Swift SDK
Virgil Core SDK allows developers to get up and running with Virgil Cards Service API quickly and add end-to-end security to their new or existing digital solutions to become HIPAA and GDPR compliant and more. -
BiometricAuth
Framework for biometric authentication (via TouchID) in your application -
TPObfuscatedString
Simple String obfuscation using core Swift. -
RSASwiftGenerator
Util for generation RSA keys on your client and save to keychain or convert into Data π π -
SwiftyKeychainKit
Modern Swift wrapper for Keychain Services API with the benefits of static typing -
VoiceItAPI1IosSDK
A super easy way to add Voice Authentication(Biometrics) to your iOS apps, conveniently usable via cocoapods -
π Vault
Simple and Secure container for passwords and other sensitive data.
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SweetHMAC or a related project?
README
Sweet HMAC
SweetHMAC
is a tiny and easy to use Swift class to encrypt strings using HMAC algorithms.
A special thanks to jernejstrasner for shared HMACDigest Gist, that inspired to create this simple class and String extension.
Usage examples
There are two ways to use Sweet HMAC in your projects
1. by String extension
// Will output this string: e470f785afb708cd8c2a31860642fd11
"I'm going to make him an offer he can't refuse".HMAC(.md5, secret:"Vito Corleone")
2. by SweetHMAC class
let quote = "I'm going to make him an offer he can't refuse"
let author = "Vito Corleone"
// Create a SweetHMAC instance with your message and secret strings
let digest:SweetHMAC = SweetHMAC(message: quote, secret: author)
// Pick some computed HMAC output based on some algorithm using "HMAC" method...
let md5 = digest.HMAC(algorithm: .md5)
// ...or do it more "Sweet" like this
let md5 = SweetHMAC(message: quote, secret: author).HMAC(.MD5)
Supported HMAC algorithms
- MD5
- SHA1
- SHA224
- SHA256
- SHA384
- SHA512
Installation
SweetHMAC have many clear and simple options to be used in any iOS or OSX projects.
Using dependency manager
Actually SweetHMAC can be used with those dependency managers
- CocoaPods
- Carthage
CocoaPods
You can use SweetHMAC with CocoaPods, specify your Podfile
like this:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
pod 'SweetHMAC', '~> 3.0'
Carthage
Also you can use Carthage to SweetHMAC framework at your project, just add SweetHMac in your Cartfile
file like this:
github "jancassio/SweetHMAC" >= 3.0
Integrated Project
As many iOS/OSX projects, you can add third party libraries in your project as well.
Embeded Framework
You can add SweetHMAC as submodule (preferred) or paste entire SweetHMAC project relative to your Xcode project, choose one of both options and after them:
- Drag
SweetHMAC.xcodeproj
from SweetHMAC folder to your project. - At Xcode, open "Project Navigator" (β+1).
- Select SweetHMAC project (the blue project icon).
- Check if SweetHMAC deployment target matches your project deployment target.
- At this point, select "Build Phases" tab.
- Click on + icon to add a new "Copy Phase". Optional: Rename this phase to "Embeded Frameworks".
- Set destination to "Frameworks".
- Add
SweetHMAC.framework
.
Source file
This is not the preferred option to add SweetHMAC in your project, because SweetHMAC depends by CommonCrypto lib to work properly and, Swift can't access this lib directly.
So if you still want to use SweetHMAC by source files, follow steps below:
- At Xcode, open "Project Navigator" (β+1).
- Select your project file (the blue project icon).
- Click on "Build Phases" tab.
- Create a new "Run Script" phase clicking on + icon.
- Drag the run script phase created to stay below the first phase (ak "Target dependencies").
- Paste the code below at run script phase created before:
COMMOM_CRYPTO_PATH=$SDKROOT/usr/include/CommonCrypto/CommonCrypto.h
COMMOM_CRYPTO_R_PATH=$SDKROOT/usr/include/CommonCrypto/CommonRandom.h
MODULE_DIR="$SRCROOT/Modules/CommonCrypto"
MODULE_FILE=$MODULE_DIR/module.map
MODULE_TEMPLATE="module CommonCrypto [system] {\n\t
header \"$COMMOM_CRYPTO_PATH\"\n\t
header \"$COMMOM_CRYPTO_R_PATH\"\n\t
export *\n
}"
echo "Create Modules path to map CommonCrypto lib"
mkdir -p "$SRCROOT/Modules/CommonCrypto"
echo "Cleanup previous CommonCrypto script to make sure the deployment target is always updated"
echo "" > $MODULE_FILE
echo "Create CommonCrypto module map template"
echo -e $MODULE_TEMPLATE > $MODULE_FILE
- Create a new file (β+N).
- Select "iOS"/"Others".
- Select "Congfiguration Settings File".
- Put any name you want.
- Add the content below in Configuration file created before:
SWIFT_INCLUDE_PATHS="$SRCROOT/Modules"
- Go to your project file in "Project Navigator" (β+1)
- Select your project file and select your project above your project targets.
- Change configurations for the last one you created for each target you are using SweetHMAC by source.
- Build your project.
Quick Observation
Each time you change your deployment device for example, from Simulator to Device, you should build your project, because the script added in build phase, will use the current operational system selected in your Xcode scheme to construct the absolute path to the CommonCrypto header relative of Simulator SDK or iPhoneOS SDK.
License
Copyright (c) 2014 Jan Cassio. All rights reserved.
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.
*Note that all licence references and agreements mentioned in the SweetHMAC README section above
are relevant to that project's source code only.