I want to connect a programm to the OBS Websocket Plugin and need to encrypt the password to match the encryption of the plugin as an authentification. Here is explained how I have to encrypt the password but ony the encryption from this Site worked.
I have to generate a binary SHA256 hash and encode the result to Base64 but this code won't work: Marshalls.utf8_to_base64( str((passwort+salt).sha256_text() ) )
Example Strings with expected output:
1. Data from OBS Websocket: {"authRequired":true,"challenge":"l5BYHeT6ajjiU50aAt97PKzvYJXMVCOwjRn4AWRylXk=","message-id":"auth_request","salt":"Ue+UWGL1GUN4b7SWTcGJ+7b9rjwmWtRVdOIqzt5qfkc=","status":"ok"}
Password: "testtest"
2. password+salt -> binarysha256 -> Base64 encryption
3. result from 2. +challenge -> binarysha256 -> Base64 encryption
Result from 2. (password+salt): zoa5uikt6WyiwaKU3PMVj+TYao+miy3hyQ6HisYXt20=
Result from 3. (2. + challenge): VXGXqUbOxTwxICHvnObyZv9+2o4OLuXH5qxJ7AupzaY=
The 3rd result is the final and worked but only with the website and not with Godot.
I hope someone can explaine where the mistake in this code is.
Unfortunately i am not familiar with encryption and hashing.