Skip to content

Commit

Permalink
maybe?
Browse files Browse the repository at this point in the history
  • Loading branch information
boomzero committed Aug 14, 2024
1 parent 408454b commit 372bf75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ export class Process {
if (Data["Content"].length > 2000) {
return new Result(false, "短消息过长");
}
let encryptedContent = "Begin xssmseetee v1 encrypted message" + CryptoJS.AES.encrypt(Data["Content"], this.shortMessageEncryptKey).toString();
let encryptedContent = "Begin xssmseetee v1 encrypted message" + CryptoJS.AES.encrypt(Data["Content"], this.shortMessageEncryptKey + this.Username + Data["ToUser"]).toString();
const MessageID = ThrowErrorIfFailed(await this.XMOJDatabase.Insert("short_message", {
message_from: this.Username,
message_to: Data["ToUser"],
Expand Down Expand Up @@ -945,7 +945,7 @@ export class Process {
for (const i in Mails) {
const Mail = Mails[i];
if (Mail["content"].startsWith("Begin xssmseetee v1 encrypted message")) {
Mail["content"] = CryptoJS.AES.decrypt(Mail["content"].substring(37), this.shortMessageEncryptKey).toString();
Mail["content"] = CryptoJS.AES.decrypt(Mail["content"].substring(37), this.shortMessageEncryptKey + Mail["message_from"] + Mail["message_to"]).toString();
} else {
let preContent = Mail["content"];
Mail["content"] = "无法解密消息, 原始数据: " + preContent;
Expand Down

0 comments on commit 372bf75

Please sign in to comment.