Enigma encryption in Swift

Overview

๐•ฐ๐–“๐–Ž๐–Œ๐–’๐–†๐•ถ๐–Ž๐–™

CI Status Version License Platform Alt text

๐–€๐–˜๐–†๐–Œ๐–Š

// Will create an Enigma with an empty plugboard, rotors I, II, III and reflector B (wide).
let enigma = Enigma()
// Will output "ILBDA AMTAZ"
let result = enigma.encode("HELLO WORLD")
let enigma = Enigma()
// "HELLO WORLD"
let result = enigma.encode("ILBDA AMTAZ")

๐•ฎ๐–”๐–’๐–•๐–”๐–“๐–Š๐–“๐–™๐–˜

๐•ป๐–‘๐–š๐–Œ๐–‡๐–”๐–†๐–—๐–‰

// Create a plugboard and add a patch between A and D
let plugboard = Plugboard()
plugboard.add(("A", "D"))

๐•ฝ๐–”๐–™๐–”๐–—

// III rotor. EnigmaKit comes prebuilt with rotors I-VIII
let rotor = Rotor.III
rotor.setting = 5 // Ringstellung
rotor.position = 6 // Grundstellung

// Or initialize your own
let rotor = Rotor(name: "My custom rotor", wiring: "VZBRGITYUPSDNHLXAWMJQOFECK", notch: "QV")

๐•ฝ๐–Š๐–‹๐–‘๐–Š๐–ˆ๐–™๐–”๐–—

// EnigmaKit comes with reflectors A-C (wide) and B-C (thin)
let reflector = Reflector.B

// Or you can create your own reflector
let reflector = Reflector(name: "My custom reflector", wiring: "VZBRGITYUPSDNHLXAWMJQOFECK")

๐•ฐ๐–“๐–Ž๐–Œ๐–’๐–†

// Create an enigma with your own plugboard, rotors and reflector of choice
let enigma = Enigma(reflector: Reflector.C, rotors: [Rotor.III, Rotor.IV, Rotor.II], plugboard: Plugboard())

๐•ฝ๐–Š๐––๐–š๐–Ž๐–—๐–Š๐–’๐–Š๐–“๐–™๐–˜

Don't mention the war

๐•ด๐–“๐–˜๐–™๐–†๐–‘๐–‘๐–†๐–™๐–Ž๐–”๐–“

EnigmaKit is available through Swift Package Manager, CocoaPods.

๐•ฌ๐–š๐–™๐–๐–”๐–—

Joakim Gyllstrรถm, [email protected]

๐•ท๐–Ž๐–ˆ๐–Š๐–“๐–˜๐–Š

EnigmaKit is available under the MIT license. See the LICENSE file for more info.

You might also like...
Simple and secure hashing in Swift with the SipHash algorithm

SipHash โš ๏ธ WARNING This package has been obsoleted by the Hasher type and the Hashable.hash(into:) requirement introduced in Swift 4.2. Using this pac

Virgil Crypto stack Objective-C/Swift

Virgil Crypto Library Objective-C/Swift Introduction | Library purposes | Installation | Usage examples | Docs | License | Contacts Introduction Virgi

A framework for the JOSE standards JWS, JWE, and JWK written in Swift.

JOSESwift is a modular and extensible framework for the JOSE standards JWS, JWE, and JWK written in Swift. ๐Ÿ’ก Please note that this implementation of

RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

CCCryptor (AES encryption) wrappers for iOS and Mac in Swift. -- For ObjC, see RNCryptor/RNCryptor-objc

RNCryptor Cross-language AES Encryptor/Decryptor data format. The primary targets are Swift and Objective-C, but implementations are available in C, C

RSA public/private key generation, RSA, AES encryption/decryption, RSA sign/verify in Swift with CommonCrypto in iOS and OS X

SwCrypt Create public and private RSA keys in DER format let (privateKey, publicKey) = try! CC.RSA.generateKeyPair(2048) Convert them to PEM format l

RSA public/private key encryption in Swift

SwiftyRSA Maintainer(s): @ikeith Public key RSA encryption in Swift. SwiftyRSA is used in the Scoop iOS app to encrypt driver license numbers before s

CCCryptor (AES encryption) wrappers for iOS and Mac in Swift. -- For ObjC, see RNCryptor/RNCryptor-objc

RNCryptor Cross-language AES Encryptor/Decryptor data format. The primary targets are Swift and Objective-C, but implementations are available in C, C

SecureDefaults is a wrapper over UserDefaults/NSUserDefaults with an extra AES-256 encryption layer

SecureDefaults for iOS, macOS Requirements โ€ข Usage โ€ข Installation โ€ข Contributing โ€ข Acknowledgments โ€ข Contributing โ€ข Author โ€ข License SecureDefaults is

ChatSecure is a free and open source encrypted chat client for iOS that supports OTR and OMEMO encryption over XMPP.

ChatSecure ChatSecure is a free and open source XMPP messaging client for iOS that integrates OTR and OMEMO encrypted messaging support, and has optio

surespot is a mobile messaging application that secures all messages using end-to-end encryption.

surespot-ios ios surespot client surespot is a mobile messaging application that secures all messages using end-to-end encryption. Contribute surespot

A lightweight wrapper over UserDefaults/NSUserDefaults with an additional layer of AES-256 encryption

SecureDefaults for iOS, macOS Requirements โ€ข Usage โ€ข Installation โ€ข Contributing โ€ข Acknowledgments โ€ข Contributing โ€ข Author โ€ข License SecureDefaults is

Apple cloudkit sample encryption

CloudKit Samples: Encryption Goals This project demonstrates using encrypted values with CloudKit and iCloud containers. CloudKit encrypts data with k

An easy way for hashing and encryption.
An easy way for hashing and encryption.

CatCrypto include a series of hashing and encryption functions and more functions in progress! CatCrypto also contains Swift bindings of Argon2, the p

Heimdall is a wrapper around the Security framework for simple encryption/decryption operations.
Heimdall is a wrapper around the Security framework for simple encryption/decryption operations.

Heimdall In Norse mythology, Heimdall is the gatekeeper of Bifrรถst, the rainbow road connecting Midgard, realm of the humans, to Asgard, the realm of

The app encrypts or decrypts user's text input with basic encryption and decryption algorithms
The app encrypts or decrypts user's text input with basic encryption and decryption algorithms

Objective-C Wrapper Project About The Project The app encrypts or decrypts user's text input with basic encryption and decryption algorithms. Purpose

Encryption/Decryption for React Native

@dhairyasharma/react-native-encryption Encryption/decryption for React Native. Benchmark File Details File Link http://bit.do/benchmarkfile File Size

Encryption/Decryption for React Native

@dhairyasharma/react-native-encryption Encryption/decryption for React Native. Benchmark File Details File Link http://bit.do/benchmarkfile File Size

Owner
Joakim Gyllstrรถm
Currently in a steady relationship with Swift โค๏ธ
Joakim Gyllstrรถm
RSA public/private key encryption in Swift

SwiftyRSA Maintainer(s): @ikeith Public key RSA encryption in Swift. SwiftyRSA is used in the Scoop iOS app to encrypt driver license numbers before s

Scoop 1.1k Jan 5, 2023
CCCryptor (AES encryption) wrappers for iOS and Mac in Swift. -- For ObjC, see RNCryptor/RNCryptor-objc

RNCryptor Cross-language AES Encryptor/Decryptor data format. The primary targets are Swift and Objective-C, but implementations are available in C, C

null 3.3k Jan 7, 2023
An easy way for hashing and encryption.

CatCrypto include a series of hashing and encryption functions and more functions in progress! CatCrypto also contains Swift bindings of Argon2, the p

Kcat 62 Sep 27, 2022
A wrapper for Apple's Common Crypto library written in Swift.

IDZSwiftCommonCrypto A Swift wrapper for Apple's CommonCrypto library. IDZSwiftCommonCrypto works with both CocoaPods and Cathage. For more details on

idz 472 Dec 12, 2022
Read my answer here Importing CommonCrypto in a Swift framework

Read my answer here Importing CommonCrypto in a Swift framework

Khoa 281 Sep 17, 2022
A pure Swift implementation of MD5

SwiftMD5 SwiftMD5 is a pure Swift implementation for the MD5 algorithm. Usage import SwiftMD5 "The quick brown fox jumps over the lazy dog".md5 // "9

Matthew Purland 11 Sep 25, 2021
๐Ÿ• MD5 in pure Swift

SwiftHash โค๏ธ Support my app โค๏ธ Push Hero - pure Swift native macOS application to test push notifications Quick Access - Organise files in the Mac men

Khoa 207 Dec 24, 2022
A tiny and easy to use Swift class to encrypt strings using HMAC algorithms.

#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 HM

Jan Cรกssio 37 Jul 27, 2022
CryptoSwift is a growing collection of standard and secure cryptographic algorithms implemented in Swift

CryptoSwift Crypto related functions and helpers for Swift implemented in Swift. (#PureSwift) Note: The main branch follows the latest currently relea

Marcin Krzyzanowski 9.4k Jan 9, 2023
Elegant Swift interface to access the CommonCrypto routines

SCrypto [Overview โ€ข Requirements โ€ข Installation โ€ข Usage โ€ข Alternatives โ€ข Licence] Overview SCrypto provides neat Swift interface to access the CommonC

Max 39 Mar 31, 2022