Re: Some BGT internals questions

2019-10-23 Thread AudioGames . net Forum — Developers room : tyrylu via Audiogames-reflector


  


Re: Some BGT internals questions

@27: I understand your viewpoint and if curiosity is not enough, there seems not to be any argument which i can think of which would help.@28: Padding could be the cause, but it should add a block only if the input has exactly block size bytes, which for AES is 16, not 8. Of course, it could be some special padding, nothing from the list from https://www.cryptosys.net/pki/manpki/pk … hemes.html

URL: https://forum.audiogames.net/post/470254/#p470254




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-23 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Some BGT internals questions

@24, a 9-byte length string producing a 32-byte length string is not uncommon fro CBC. CBC uses padding to make up for lost or unavailable bytes. So if you pass in a length 13 string (104 bits) the AES CBC cipher will pad the remaining 19 bytes like this: 01020304050607080910111213141516171819. This is why AES CBC is vulnerable to a padding oracle attack.Edit: Just like to note that I might be wrong on how the padding is done, but input is definitely padded if it is shorter than the encoder block size.

URL: https://forum.audiogames.net/post/470209/#p470209




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-23 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Some BGT internals questions

@24, a 9-byte length string producing a 32-byte length string is not uncommon fro CBC. CBC uses padding to make up for lost or unavailable bytes. So if you pass in a length 13 string (104 bits) the AES CBC cipher will pad the remaining 19 bytes like this: 01020304050607080910111213141516171819. This is why AES CBC is vulnerable to a padding oracle attack.

URL: https://forum.audiogames.net/post/470209/#p470209




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-23 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: Some BGT internals questions

Since I don't support BGT anymore, spending the time making it possible to interoperate with it would not really make sense in terms of productivity. I want to encourage people to move away from BGT, not to hold on to it and making it easier to do so by releasing parts of the code. Does that make sense?Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/470181/#p470181




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-23 Thread AudioGames . net Forum — Developers room : tyrylu via Audiogames-reflector


  


Re: Some BGT internals questions

What about a client/server game with the server written in something more cross platform and more performant? That's partly doable if you implement your own encryption scheme (you might be able to call OpenSSL/Libsodium from bgt, but i haven't tried it), but the details would allow not reinventing the wheel.Of course, there will not be many (if any) developers which would go that route, but at least, the route would be there.

URL: https://forum.audiogames.net/post/470178/#p470178




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-23 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: Some BGT internals questions

You can use BGT itself to decrypt data if you really need to, so I think that should be enough to maintain older projects to the extent that it is warrented. I don't have any interest in publishing all the details at this time, as I don't really see any useful purpose being served by doing so.Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/470166/#p470166




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-23 Thread AudioGames . net Forum — Developers room : tyrylu via Audiogames-reflector


  


Re: Some BGT internals questions

I understand, open sourcing the implementation could suggest to some folks that it should be used and such. But the point of the main question wasn't to get the source code in the first place, the reason was more software archeology related - e. g. that there would be enough information to recreate the algorithm if someone needs to (for some reasons) decrypt some BGT encrypted stuff.The fact that it is AES 256 (which you stated in the official docs) is unfortunately not enough to do so, at least the key derivation (is it the SHA-256 hash of the password or something more criptic?) and the IV (same questions) would be needed to do this. Of course, then there's the issue of a length 9 string producing a length 32 output (which should not happen under normal AES if the string was fet as it was), but that probably should be all (any ciphertext transformations for obscurity notwithstanding).

URL: https://forum.audiogames.net/post/470165/#p470165




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: Some BGT internals questions

I don't think so. I'm sorry. If you want to implement encryption, pick up Libtomcrypt if you are comfortable in C, or Crypto++ if you are more of a C++ person, and you'll be well on your way.Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/470157/#p470157




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : tyrylu via Audiogames-reflector


  


Re: Some BGT internals questions

@15: I don't see anything above the AES block length in case of string_encrypt (yes, there's a header of some sort for file_encrypt processed files).@21: Would you be willing to open source only the encryption related code, with all the disclaimers of bad C++ code you can think of? That would answer all the implementation questions (or at least they could be answered).

URL: https://forum.audiogames.net/post/470156/#p470156




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: Some BGT internals questions

Because it was written at a time when I myself was learning C++, when I was about 17 - 18 years old and is certainly not a good example of how to write good code. It worked OK, but is not something I would like to have out there in source code form.However, I will be releasing some open source libraries to the public domain on my Github, so stay tuned for that if you're interested.Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/470152/#p470152




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector


  


Re: Some BGT internals questions

@philip_bennefall, a question: why don't you make bgt open source? you are not working on it anymore, maybe someone else at least can learn from it!.

URL: https://forum.audiogames.net/post/470141/#p470141




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector


  


Re: Some BGT internals questions

@philip_bennefall, a question: why don't you open source bgt? you are not working on it anymore, maybe someone else at least can learn from it!.

URL: https://forum.audiogames.net/post/470141/#p470141




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: Some BGT internals questions

There's also libtomcrypt, which is a rather lightweight and modular option if you are prepared to figure out which source files you can exclude.Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/470102/#p470102




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Some BGT internals questions

Sad thing about tiny-aes is that it only provides the CBC cipher mode. It provides no others, which means that if you want something more than Tiny AES you need to use a fuller library like Monocypher or something huge like OpenSSL.

URL: https://forum.audiogames.net/post/470093/#p470093




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: Some BGT internals questions

I do know about tiny-aes, but that's not what's being used. The encryption stuff was implemented in 2008, long before tiny-aes was available.Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/470088/#p470088




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector


  


Re: Some BGT internals questions

@12 I think you used tiny-aesthat is available on GitHub if you check, correct me if I'm wrong

URL: https://forum.audiogames.net/post/470076/#p470076




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: Some BGT internals questions

There is a very short header prepended to the string so that the decryption function can verify whether decryption was successful or not. That's why you get two blocks.Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/470061/#p470061




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : tyrylu via Audiogames-reflector


  


Re: Some BGT internals questions

@9, Just some experiments.@10, The output block size makes sense, but if you pass a string of length 9, you get two output blocks, which is somewhat weird - the input block size should be equal to the output block size (see wikipedia for proof) (it would not be weird if the strings were internally encoded to UTF-16 before encrypting, but that's even weirder). And of course, you still have to pass the correct IV for CBC mode. It does not appear to be prepended to the encrypted string, so it must be somehow derived from the data or password, or it appears almost as if the IV was dependent on the password length...

URL: https://forum.audiogames.net/post/470059/#p470059




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Some BGT internals questions

@12, I figured you did something like that -- or used key derivation or padding. Thanks for the info -- I feel a lot better when I know what crypto algorithms software uses.

URL: https://forum.audiogames.net/post/470047/#p470047




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: Some BGT internals questions

Without going into all the details, here's some brief information. I did not actually write the encryption code, that was work made for hire. I was not familiar enough with encryption at the time, about 11 years ago, to feel confident enough to take a stab at it myself. So I hired another coder to do it. We used the public domain C implementation of AES, as written by the original authors. I believe we used CBC mode, which has a block size of 16 bytes if I recall correctly. So that's why you get 16 bytes even when you encrypt a shorter string. I use 256 bit keys, and they are not just a copy of the string that the user passes.Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/470043/#p470043




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-22 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Some BGT internals questions

@10, makes sense -- if he used windows APIs, that's what he'd get.

URL: https://forum.audiogames.net/post/470010/#p470010




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-21 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


Re: Some BGT internals questions

void main()
{
alert("test", string_len(string_encrypt("a", "abc")));
}This produces a block size of 128 bits... Am I missing something?Thanks for the reverse engineering challenge, might be interesting to see what I may be able to pull off at some later point.

URL: https://forum.audiogames.net/post/469966/#p469966




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-21 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Some BGT internals questions

@8, how did you determine that? Now I'm curious!If the input block size is 64 then his encryption is beyond piss-poor (especially if that includes keys). That doesn't sound like Phillip though -- I don't think he'd do something that stupid and expect it to be secure.

URL: https://forum.audiogames.net/post/469916/#p469916




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-21 Thread AudioGames . net Forum — Developers room : tyrylu via Audiogames-reflector


  


Re: Some BGT internals questions

Someone got any idea why the input block size is 64 bit when for any AES it should be 128 bit, which there produces two output blocks and not the one i'd expect?

URL: https://forum.audiogames.net/post/469909/#p469909




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-15 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Some BGT internals questions

@6, again, I don't know what cipher mode he actually uses. He could be using what I suspect -- either CBC or CTR, since those are the two most common -- but he could also be using CFB, OFB, GCM, etc.

URL: https://forum.audiogames.net/post/468634/#p468634




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-15 Thread AudioGames . net Forum — Developers room : tyrylu via Audiogames-reflector


  


Re: Some BGT internals questions

#4, I assume the same, but i was never able to decrypt a blob encrypted by string_encrypt in, for example Python.

URL: https://forum.audiogames.net/post/468629/#p468629




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-15 Thread AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector


  


Re: Some BGT internals questions

There is no harm in knowing such things, and honestly, people who continue to use BGT at this time are just stubborn and whatever happens as a result is their own fault for not moving on.

URL: https://forum.audiogames.net/post/468583/#p468583




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-15 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Some BGT internals questions

@2, I disagree. Knowing this information is an extremely useful thing to know. An adversary can easily figure out this information if trying to crack the cipher the usual way. However, I can make some theories:1) The cipher mode was most likely CBC or CTR (cipher block chaining or counter). I significantly doubt he used ECB. CBC is vulnerable to a padding oracle attack, whereas CTR is not, but this is a minor implementation detail for something like BGT.2) Considering how intelligent Phillip is, I doubt he used the password/key you entered as the real "encryption key". I can deduce this from the fact that, when breaking the algorithm by using the bytecode in my favor, as well as knowing where everything was in memory (all the time), the key was definitely not ASCII. Usually it was a ton of unicode characters, including some control characters. Using this as a deduction guide, I can assume, with a relatively high chance of being right, that he used a key derivation function (KDF) like PBKDF2 (or something else), or hashed the password and then used the raw digest as the key. Alternatively, he also might've used a keyed hash. The advantage to either approach is that while I could decrypt anything encrypted, I never truly knew the string you passed to any of the encryption functions because I would get the resulting key that the engine generated (rather than the data you passed to the function).I could be totally wrong, though. He may have used any other cipher mode or method of storing or deriving of cryptographic keys.

URL: https://forum.audiogames.net/post/468581/#p468581




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-15 Thread AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector


  


Re: Some BGT internals questions

nah, BGT had it's time, it was great, but i am going to use lucia now. it's the best for now!

URL: https://forum.audiogames.net/post/468561/#p468561




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Some BGT internals questions

2019-10-15 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Some BGT internals questions

Just because the language has been discontinued does not mean that there will not be any games made from it. While I would be interested to see how the internals work, I believe that sharing such information would cause a lot of damage.

URL: https://forum.audiogames.net/post/468559/#p468559




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Some BGT internals questions

2019-10-15 Thread AudioGames . net Forum — Developers room : tyrylu via Audiogames-reflector


  


Some BGT internals questions

Hello.So, now, when the abandonment of BGT was offically announced, could someone (very likely Filip) explain how the encryption worked (AES mode, key generation from the password etc.), so a compatible implementation (for example for a server) could be build?And the format of the output of file_encrypt could probably be disclosed as well (you already know the key, right?) :-).I tried almost anything - ECB with the key equal to the SHA1 hash of the password, CBC with a fixed IV equal to 16 zeroes etc.

URL: https://forum.audiogames.net/post/468527/#p468527




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector