Security Kit is a lightweight framework that helps to achieve a security layer
• Example • Usage • Installation • License
To run the example project, run pod try SecurityKit
Language | Branch | Pod version | Xcode version | iOS version |
---|---|---|---|---|
Swift 5.0 | master | >= 1.0.x | Xcode 10+ | iOS 12.0+ |
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate SecurityKit into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
use_frameworks!
target '<Your Target Name>' do
pod 'SecurityKit'
end
Then, run the following command:
$ pod install
pod 'SecurityKit'
import SecurityKit
if SecurityKit.isDeviceJailBroken() {
// Do Something
}else{
// Do Something
}
import SecurityKit
if SecurityKit.isDeviceSimulator() {
// Do Something
}else{
// Do Something
}
import SecurityKit
if SecurityKit.isRevereseEngineeringToolsExecuted() {
// Do Something
}else{
// Do Something
}
import SecurityKit
if SecurityKit.isVPNConnected() {
// Do Something
}else{
// Do Something
}
import SecurityKit
override func viewDidLoad() {
super.viewDidLoad()
ScreenCaptureProtection.shared.makeProtection(for: self.view)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(false)
ScreenCaptureProtection.shared.removeScreenProtection(for: self.view)
}
import SecurityKit
var window: UIWindow?
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
guard let image = UIImage(named: "Placeholder") else {return}
SecurityKit.createSecureScreenShot(window: window, image: image)
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
SecurityKit.removeSecureScreenShot(window: &window)
}
import SecurityKit
// String Encryption
let encrypt = SecurityKit.stringEncryption(plainText: "plainText", encryptionKey: "key")
// String Decryption
let decrypt = SecurityKit.stringDecryption(cypherText: encrypt, decryptionKey: key)
SecurityKit is available under the MIT license. See the LICENSE file for more info.