# macOS Cryptography Swift Samples

macOS Swift cryptography examples including hash functions, encryption/decryption, and digital signatures

> Canonical page: https://elysiatools.com/en/samples/macos-cryptography-swift

- **Category:** Swift

- **Keywords:** swift, macos, cryptography, hash, encryption, decryption, aes, rsa, hmac, signatures

## Overview

macOS Swift cryptography examples including hash functions, encryption/decryption, and digital signatures

## Examples

- **Hash Functions**: Compute MD5, SHA-1, SHA-256, and SHA-512 hashes using CommonCrypto and CryptoKit
- **Encryption/Decryption**: Encrypt and decrypt data using AES symmetric encryption and RSA asymmetric encryption
- **Digital Signatures**: Create and verify digital signatures using RSA and ECDSA algorithms

## When to use

- Use this sample set when you want reference inputs for macOS Cryptography Swift Samples.
- Use it to preview output formats and compare related sample variants.

## How it works

- Open a sample entry to inspect the prepared example payload or asset.
- Compare it with related tools to understand how the workflow connects.

## Use cases

- Hash Functions
- Encryption/Decryption
- Digital Signatures

## Frequently asked questions

### What is included in macOS Cryptography Swift Samples?

This page includes curated sample entries, related tools, and neighboring sample collections for macOS Cryptography Swift Samples.

## Related tools

- [IBAN & SWIFT Validator](https://elysiatools.com/en/tools/iban-swift-validator): Validate International Bank Account Number (IBAN) and SWIFT/BIC codes with checksum verification
- [SWIFT Code Validator](https://elysiatools.com/en/tools/swift-code-validator): Validate SWIFT/BIC bank identification codes
- [RSA Encrypt / Decrypt](https://elysiatools.com/en/tools/rsa-encrypt-decrypt): Encrypt text with an RSA public key or decrypt ciphertext with the matching private key, using OAEP padding (SHA-1 or SHA-256). Handles long messages by chunking. Keys and data stay local. PKCS#1 v1.5 is intentionally not offered (Node disables it for decryption due to Bleichenbacher attacks).
- [AES Encryption Tool](https://elysiatools.com/en/tools/aes-encryption-tool): Encrypt or decrypt text and files with AES-256-GCM and export IV-based bundles
- [Bcrypt Generator](https://elysiatools.com/en/tools/bcrypt-generator): Generate bcrypt hash from password
- [Digital Signature Generator](https://elysiatools.com/en/tools/digital-signature-generator): Sign a message with a private key or verify a signature with a public key — supports RSA-PSS (SHA-256), ECDSA (P-256), and Ed25519. Pure client-side crypto (Node crypto.createSign/createVerify), no network. Paste a PEM key to sign or to verify a base64 signature. This tool signs/verifies; it does not generate key pairs.
- [Hash Algorithm Comparator](https://elysiatools.com/en/tools/hash-algorithm-comparator): Hash the same input with MD5, SHA-1, SHA-256, SHA-512, BLAKE2b, and BLAKE3 at the same time and compare them side by side: output length, hex/Base64 digest, security status (broken / modern), and a relative speed benchmark. Great for teaching, choosing a hashing algorithm, or sanity-checking checksums.
- [HMAC Generator & Verifier](https://elysiatools.com/en/tools/hmac-generator-verifier): Compute an HMAC message-authentication signature over a message + shared secret using SHA-1/SHA-2/SHA-3/BLAKE2, or verify an incoming signature against the secret — with webhook presets for Stripe / Slack / GitHub and constant-time comparison

## Related content

- [Android Cryptography Java Samples](https://elysiatools.com/en/samples/android-cryptography-java): Android Java cryptography examples including hash calculation, AES encryption/decryption, and Base64 encoding
- [Android Cryptography Kotlin Samples](https://elysiatools.com/en/samples/android-cryptography-kotlin): Android Kotlin cryptography examples including hash calculation, AES encryption/decryption, and Base64 encoding
- [Cryptography and Encryption Samples](https://elysiatools.com/en/samples/cryptography): Comprehensive cryptography examples including symmetric encryption, asymmetric encryption, hash functions, digital signatures, and key exchange protocols
- [Web Cryptography Go Samples](https://elysiatools.com/en/samples/web-cryptography-go): Web Go cryptography and security examples including hash calculation, symmetric encryption, and Base64 encoding/decoding
- [Web Cryptography Python Samples](https://elysiatools.com/en/samples/web-cryptography-python): Web Python cryptography and security examples including hash computation, symmetric encryption, and Base64 encoding
- [Windows Cryptography C++ Samples](https://elysiatools.com/en/samples/windows-cryptography-cpp): Windows C++ cryptography examples including hash calculation, AES encryption/decryption, and Base64 encoding/decoding
