IceMetalPunk
Member
I'm currently working on a game in GM:S 2.2.5, using Lintydude's AES library found here. I'm using it to encrypt communication between the game client and a NodeJS server I built for the game (to store things like player scores, player collectibles, etc., especially since the collectibles will be from a common pool for all players). However, I'm getting a different output from the AES library than I am from JavaScript's Subtle Crypto API, making it impossible for the server to properly decrypt the requests.
I've verified that both the server and client have the exact same AES-256 key, which is this in hex:
(On the server, I'm just importing the key as it was exported, in base64url encoding for JWK; on the client, I'm decoding it and converting it to hex. In either case, I've confirmed that the key is the same on both ends.)
However, when trying to test it with the message
Using Lintydude's library, this is the code I'm using:
Is the library implemented wrong, or am I missing something?
I've verified that both the server and client have the exact same AES-256 key, which is this in hex:
9B13A3D0FA4F8DBDF752C3374F243642568D5BB41ECFBB6E832308C3C7387CB7
(On the server, I'm just importing the key as it was exported, in base64url encoding for JWK; on the client, I'm decoding it and converting it to hex. In either case, I've confirmed that the key is the same on both ends.)
However, when trying to test it with the message
Hello, world
in CBC mode, I get the following results:They're both encrypting the same "Hello, world" message with the same key (and the same initialization vector, which is just all hex 1's for testing), yet they produce different results, which is halting all my progress.SERVER:
6EE120C7ED50B339C5646108FDE79CD9
GML:
2825730989E85252B0BBC7C961714CE2
Using Lintydude's library, this is the code I'm using:
GML:
aes_init(256);
var iv = "11111111111111111111111111111111";
get_string("TEST ENCRYPTION", aes_string("Hello, world", hex_key, iv, 0,1,1,0,1,1));