-
《MobileLibrary》是一款提供多种加密算法的Swift库。
-
使用此库可以安全地加解密文本数据。
-
此库提供三种主要的加密方式:XOR加密、Caesar加密、Vigenere加密。
要将《MobileLibrary》添加到您的项目中,请在`Package.swift`文件中添加以下内容
dependencies: [
.package(url: "https://github.com/yourusername/MobileLibrary.git", from: "1.0.0")
]
接下来,将MobileLibrary添加到目标中
.target(
name: "YourTargetName",
dependencies: [
"MobileLibrary"
]
),
使用MobileLibrary加密和解密文本数据的方法非常简单。此库支持三种主要的加密方式(XOR、Caesar、Vigenere)。
以下示例展示了如何使用基本设置初始化MobileLibrary
import MobileLibrary
let mobileLibrary = MobileLibrary(xorKey: 0x55, caesarShift: 3, vigenereKey: "KEY")
let plaintext = "Hello, World!"
if let encrypted = mobileLibrary.jongmunEncrypt(plaintext) {
print("Encrypted (Jongmun): \(encrypted)")
if let decrypted = mobileLibrary.jongmunDecrypt(encrypted) {
print("Decrypted (Jongmun): \(decrypted)")
}
}
let plaintext = "Hello, World!"
let encrypted = mobileLibrary.soheeEncrypt(plaintext)
print("Encrypted (Sohee): \(encrypted)")
let decrypted = mobileLibrary.soheeDecrypt(encrypted)
print("Decrypted (Sohee): \(decrypted)")
let plaintext = "Hello, World!"
let encrypted = mobileLibrary.seonghunEncrypt(plaintext)
print("Encrypted (Seonghun): \(encrypted)")
let decrypted = mobileLibrary.seonghunDecrypt(encrypted)
print("Decrypted (Seonghun): \(decrypted)")
如果您想为此项目做出贡献,请通过GitHub问题报告来提交错误报告或功能建议。所有贡献都备受欢迎!本项目遵循MIT许可。有关详情,请参阅LICENSE文件。
本项目根据MIT许可证授权。有关详情,请参阅LICENSE文件。