Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoreSecurity

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.


✨ Features

  • Data Encryption
  • Data Decryption
  • HMAC Generation
  • Built-in Logger Support
  • Lightweight & Dependency-Friendly
  • Designed for Clean Architecture usage

📦 Installation

Swift Package Manager

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")
]

🚀 Usage

Import Module

import CoreSecurity

Encrypt Data

let encrypted = try CoreSecurity.encrypt(
    data: plainTextData,
    key: secretKey
)

Decrypt Data

let decrypted = try CoreSecurity.decrypt(
    data: encryptedData,
    key: secretKey
)

Generate HMAC

let hmac = CoreSecurity.generateHMAC(
    data: payloadData,
    key: secretKey
)

🧩 Use Case

This package is useful for:

  • Secure API communication
  • Payload signing
  • Token protection
  • Local sensitive data protection
  • Cross-platform encryption alignment (e.g. iOS ↔ Android)

🏗 Architecture Fit

Works well in:

  • Service Layer
  • Network Layer
  • Security Layer
  • Clean Architecture projects
  • Modular iOS apps

📁 Structure

Sources/
 └── CoreSecurity/
      ├── Encryption
      ├── Decryption
      ├── HMAC
      └── Logger

🔐 Design Goals

  • Keep security logic centralized
  • Avoid duplicated crypto implementation
  • Provide consistent encryption across modules
  • Improve maintainability and testability

📄 License

MIT License


👨‍💻 Author

Created by Dhika Aditya


🤝 Contribution

Feel free to open issues or submit pull requests.

About

CoreSecurity(SPM) for Swift (iOS). Lightweight Swift Package providing encryption, decryption, and HMAC utilities for secure iOS app communication

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages