style: 移除aes随机字节序列的代码
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package machine
|
package machine
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/rand"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"hash/fnv"
|
"hash/fnv"
|
||||||
@@ -112,18 +111,6 @@ func Launch() {
|
|||||||
}
|
}
|
||||||
codeFileWrite(LaunchInfo)
|
codeFileWrite(LaunchInfo)
|
||||||
} else {
|
} else {
|
||||||
// 创建一个用于存储密钥的字节数组
|
|
||||||
key := make([]byte, 32)
|
|
||||||
|
|
||||||
// 使用crypto/rand包生成安全的随机字节序列
|
|
||||||
_, err := rand.Read(key)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("Error generating random key:", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 将随机生成的字节序列作为密钥打印出来
|
|
||||||
fmt.Printf("Generated AES-256 key: %x\n", key)
|
|
||||||
// 读取记录文件
|
// 读取记录文件
|
||||||
data, err := codeFileRead()
|
data, err := codeFileRead()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user