Difference between revisions of "Talk:Cryptography"

From GTAMods Wiki
Jump to navigation Jump to search
(The "old" CRC32 algorithm from the GXT article: new section)
m
Line 1: Line 1:
 +
== AES ==
 +
 
Can someone provide an example of how to decrypt GTA IV AES Encryption through C++ (Key doesn't necessarily have to be included)?
 
Can someone provide an example of how to decrypt GTA IV AES Encryption through C++ (Key doesn't necessarily have to be included)?
 
: Done. Do we really need to include implementation code for all the common hashes, though? --[[User:Steve-m|Steve-m]] 15:11, 15 February 2009 (UTC)
 
: Done. Do we really need to include implementation code for all the common hashes, though? --[[User:Steve-m|Steve-m]] 15:11, 15 February 2009 (UTC)
Line 5: Line 7:
  
 
Please, can you post some code how to use AES Encryption in Delphi?
 
Please, can you post some code how to use AES Encryption in Delphi?
: Sure. I used a stripped down version of [http://www.google.com/search?q=AesLib.pas AesLib.pas], I forgot where I got it from. Actual AES code is implemented in C and included via pre-compiled object files. --[[User:Steve-m|Steve-m]] 13:55, 17 February 2009 (UTC)
+
: Sure. I used a stripped down version of [http://www.google.com/search?q=AesLib.pas AesLib.pas], I forgot where I got it from. Actual AES code is implemented in C and included via pre-compiled object files. --[[User:Steve-m|Steve-m]] 13:55, 17 February 2009 (UTC)
<source lang="delphi">unit RockstarCrypt;
+
 
 +
<div class="NavFrame collapsed"><div class="NavHead">'''code snippet''' </div><div class="NavContent"><source lang="delphi">unit RockstarCrypt;
  
 
interface
 
interface
Line 43: Line 46:
 
end;
 
end;
  
end.</source>
+
end.</source></div>
  
HUGE thanks!)))
+
::HUGE thanks!)))
  
 
== The "old" CRC32 algorithm from the [[GXT]] article ==
 
== The "old" CRC32 algorithm from the [[GXT]] article ==
  
<div class="NavFrame collapsed"><div class="NavHead"></div><div class="NavContent"><source lang="cpp-qt">class Checksum
+
<div class="NavFrame collapsed"><div class="NavHead">'''code snippet''' </div><div class="NavContent"><source lang="cpp-qt">class Checksum
 
{
 
{
 
private:
 
private:

Revision as of 20:16, 20 February 2009

AES

Can someone provide an example of how to decrypt GTA IV AES Encryption through C++ (Key doesn't necessarily have to be included)?

Done. Do we really need to include implementation code for all the common hashes, though? --Steve-m 15:11, 15 February 2009 (UTC)
I think it's necessary for GTA's special CRC32 and One At A Time Hash (which I suppose isn't all that common). However I left SHA1 out because that is really common. Thanks for your decryption example, although do you have the library you used? --Sacky
No particular library, code is untested too. But there are tons of implementations that support those or similar functions, like OpenSSL, and usually every language/platform comes with its own library. Instead of decoding each block 16x you could as well decode all the data at once 16x (like aru does it), because of ECB that doesn't really matter (mathematically - although your CPU cache would be happier with the first method :p). --Steve-m 16:12, 16 February 2009 (UTC)

Please, can you post some code how to use AES Encryption in Delphi?

Sure. I used a stripped down version of AesLib.pas, I forgot where I got it from. Actual AES code is implemented in C and included via pre-compiled object files. --Steve-m 13:55, 17 February 2009 (UTC)