mirror of
https://github.com/Finb/Bark.git
synced 2025-12-08 21:36:01 +00:00
32 lines
697 B
Swift
32 lines
697 B
Swift
//
|
|
// CryptoSettingModel.swift
|
|
// Bark
|
|
//
|
|
// Created by huangfeng on 2022/11/10.
|
|
// Copyright © 2022 Fin. All rights reserved.
|
|
//
|
|
|
|
import CryptoSwift
|
|
import Foundation
|
|
class CryptoSettingModel: ViewModel, ViewModelType {
|
|
struct Input {}
|
|
|
|
struct Output {}
|
|
|
|
func transform(input: Input) -> Output {
|
|
return Output()
|
|
}
|
|
|
|
override init() {
|
|
super.init()
|
|
|
|
do {
|
|
let aes = try AES(key: "ABCDEFGHIJKLMNOP", iv: "1234567890123456") // aes128
|
|
let ciphertext = try aes.encrypt(Array("hello,world".utf8))
|
|
print("tttt \(ciphertext.toBase64())")
|
|
} catch {
|
|
print("tttt \(error.rawString())")
|
|
}
|
|
}
|
|
}
|