CoreSecurity is a lightweight Swift Package that provides reusable security utilities for iOS applications.
This module focuses on simplifying:
- Encryption
- Decryption
- HMAC generation
while keeping implementation clean, consistent, and easy to integrate into modular architectures.
- Data Encryption
- Data Decryption
- HMAC Generation
- Built-in Logger Support
- Lightweight & Dependency-Friendly
- Designed for Clean Architecture usage
Add this package through Xcode:
File > Add Packages...
Enter:
https://github.com/dhikadityre/CoreSecurity
Or manually via Package.swift:
dependencies: [
.package(url: "https://github.com/dhikadityre/CoreSecurity.git", from: "1.0.0")
]import CoreSecuritylet encrypted = try CoreSecurity.encrypt(
data: plainTextData,
key: secretKey
)let decrypted = try CoreSecurity.decrypt(
data: encryptedData,
key: secretKey
)let hmac = CoreSecurity.generateHMAC(
data: payloadData,
key: secretKey
)This package is useful for:
- Secure API communication
- Payload signing
- Token protection
- Local sensitive data protection
- Cross-platform encryption alignment (e.g. iOS ↔ Android)
Works well in:
- Service Layer
- Network Layer
- Security Layer
- Clean Architecture projects
- Modular iOS apps
Sources/
└── CoreSecurity/
├── Encryption
├── Decryption
├── HMAC
└── Logger
- Keep security logic centralized
- Avoid duplicated crypto implementation
- Provide consistent encryption across modules
- Improve maintainability and testability
MIT License
Created by Dhika Aditya
Feel free to open issues or submit pull requests.