//
//  String+.swift
//  Toolboxes
//
//  Created by 研发2组 on 2024/10/11.
//


import Foundation
import Security

extension String {
    /// 尝试解密响应数据
    var decrypt: String? {
        guard let aesData = AES.dataWithBase64EncodedString(base64EncodedString: self),
              let decryptedString = AES.aes256DecryptWithData(data: aesData, key: SecretKey.primary.encryptKey) else {
            return nil
        }
        return decryptedString
    }
}
