A pure Swift implementation of MD5

Related tags

Encryption SwiftMD5
Overview

Carthage compatible Build Status Swift 3.0.x

SwiftMD5

SwiftMD5 is a pure Swift implementation for the MD5 algorithm.

Usage

import SwiftMD5

"The quick brown fox jumps over the lazy dog".md5
// "9e107d9d372bb6826bd81d3542a419d6"

Usage for raw bytes

let bytes = [Byte]("The quick brown fox jumps over the lazy dog".utf8)
// md5 outputs a 16-byte digest

let encodedBytes: [Byte] = md5(bytes)
// [158, 16, 125, 157, 55, 43, 182, 130, 107, 216, 29, 53, 66, 164, 25, 214]
// Each byte would normally be encoded to a padded hexadecimal in a string
// 9e107d9d372bb6826bd81d3542a419d6

Setup

To add SwiftMD5 to your application:

Using Carthage

  • Add SwiftMD5 to your Cartfile
  • Run carthage update
  • Drag the relevant copy of SwiftMD5 into your project.
  • Expand the Link Binary With Libraries phase
  • Click the + and add SwiftMD5
  • Click the + at the top left corner to add a Copy Files build phase
  • Set the directory to Frameworks
  • Click the + and add SwiftMD5

Using Git Submodules

  • Clone SwiftMD5 as a submodule into the directory of your choice
  • Run git submodule init -i --recursive
  • Drag SwiftMD5.xcodeproj into your project tree as a subproject
  • Under your project's Build Phases, expand Target Dependencies
  • Click the + and add SwiftMD5
  • Expand the Link Binary With Libraries phase
  • Click the + and add SwiftMD5
  • Click the + at the top left corner to add a Copy Files build phase
  • Set the directory to Frameworks
  • Click the + and add SwiftMD5

License

SwiftMD5 is released under the BSD license.

You might also like...
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

🍕 MD5 in pure Swift
🍕 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

Pure makes Pure DI easy in Swift.

Pure Pure makes Pure DI easy in Swift. This repository also introduces a way to do Pure DI in a Swift application. Table of Contents Background Pure D

Linenoise-Swift  A pure Swift implementation of the Linenoise library. A minimal, zero-config readline replacement.
Linenoise-Swift A pure Swift implementation of the Linenoise library. A minimal, zero-config readline replacement.

Linenoise-Swift A pure Swift implementation of the Linenoise library. A minimal, zero-config readline replacement. Supports Mac OS and Linux Line edit

A Pure Swift implementation of the markdown mark-up language

SmarkDown A pure Swift markdown implementation consistent with Gruber's 1.0.1 version. It is released under the BSD license so please feel free to use

SwiftIB is a pure Swift implementation of the Interactive Brokers TWS API library on Mac OS X

SwiftIB is a pure Swift implementation of the Interactive Brokers TWS API library on Mac OS X, with Core Foundation of crouse. All the API interfaces are implemented. Request Market Data and Request History Data interface are thoroughly tested.

Swipe Left2Right & Right2Left, pure SwiftUI implementation
Swipe Left2Right & Right2Left, pure SwiftUI implementation

SwipeCell Preview Features Swipe cell from Left2Right & Right2Left. Destructive swipe Usage Simply add onSwipe(leading, trailing) method to your list

A fast, pure swift MongoDB driver based on Swift NIO built for Server Side Swift
A fast, pure swift MongoDB driver based on Swift NIO built for Server Side Swift

A fast, pure swift MongoDB driver based on Swift NIO built for Server Side Swift. It features a great API and a battle-tested core. Supporting both MongoDB in server and embedded environments.

BCSwiftTor - Opinionated pure Swift controller for Tor, including full support for Swift 5.5 and Swift Concurrency

BCSwiftTor Opinionated pure Swift controller for Tor, including full support for

Swift backend / server framework (Pure Swift, Supports Linux)

NetworkObjects NetworkObjects is a #PureSwift backend. This framework compiles for OS X, iOS and Linux and serves as the foundation for building power

Swift backend / server framework (Pure Swift, Supports Linux)

NetworkObjects NetworkObjects is a #PureSwift backend. This framework compiles for OS X, iOS and Linux and serves as the foundation for building power

Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. (Pure Swift, Supports Linux)

SwiftFoundation Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. Goals Provide a cross-platform in

Pilgrim - Dependency injection for Swift (iOS, OSX, Linux). Strongly typed, pure Swift successor to Typhoon.

pilgrim.ph Pilgrim is a dependency injection library for Swift with the following features: Minimal runtime-only library that works with pure Swift (s

swift-highlight a pure-Swift data structure library designed for server applications that need to store a lot of styled text

swift-highlight is a pure-Swift data structure library designed for server applications that need to store a lot of styled text. The Highlight module is memory-efficient and uses slab allocations and small-string optimizations to pack large amounts of styled text into a small amount of memory, while still supporting efficient traversal through the Sequence protocol.

CommandLineKit - A pure Swift library for creating command-line interfaces

CommandLineKit A pure Swift library for creating command-line interfaces. Note: This project is no longer maintained. It's preserved here for historic

PMJSON provides a pure-Swift strongly-typed JSON encoder/decoder

Now Archived and Forked PMJSON will not be maintained in this repository going forward. Please use, create issues on, and make PRs to the fork of PMJS

CoreXLSX is a Excel spreadsheet (XLSX) format parser written in pure Swift

CoreXLSX Excel spreadsheet (XLSX) format parser written in pure Swift CoreXLSX is a library focused on representing the low-level structure of the XML

Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web
Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web

Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web. It provides you a chance to use a pure-Swift way to work

Comments
  • Question - md5 is match with php function

    Question - md5 is match with php function

    The php MD5 has a optional parameter which is called raw_output; This parameter set result of MD5 as binary; I need to know how can I change your implementation to get the result like the php MD5 when that parameter is true? Here you can find the MD5 php document

    opened by FaShapouri 2
Releases(v0.0.2)
Owner
Matthew Purland
Matthew Purland
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 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
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

soyer 695 Dec 8, 2022
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
Enigma encryption in Swift

?????????????????? ?????????? // Will create an Enigma with an empty plugboard, rotors I, II, III and reflector B (wide). let enigma = Enigma() // Wil

Joakim Gyllström 113 Dec 16, 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
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

null 262 Dec 19, 2022
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