Skip to content

Managed C# code for the Pokemon Go API request signature encryption (port of "encrypt.c" from the r/pokemongodev efforts)

Notifications You must be signed in to change notification settings

zone117x/pokemongo-encrypt-sharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pokemongo-encryption-sharp

Managed C# code for the Pokemon Go API request signature encryption (port of "encrypt.c")


Project contains a fully managed port of the encrypt.c code as well as a p/invoke wrapper for the native encrypt.dll binaries.

The managed lib is a PCL that targets .NET 4.5.1, ASP.NET Core, Xamarin.iOS/Android/Mac.

Both libs should work on about any mono platform. However, only the 32bit & 64bit encrypt.dll Windows binaries are included.


Sample usage

byte[] input = System.Text.Encoding.UTF8.GetBytes("Sample input data..");
byte[] iv = new byte[32];
new Random().NextBytes(iv);

// using managed lib
byte[] output = PokemonGoEncryptSharp.Util.Encrypt(input, iv);

// using native wrapper lib
byte[] output = PokemonGoEncryptNative.Util.Encrypt(input, iv);

Performance

Results from running the test app

Success! Managed code produces same output as native
Performing 3000 encryption operations with both native and managed functions...
native took 0.1162 ms per round, total: 348.63 ms
managed took 0.2669 ms per round, total: 800.9 ms
managed is 2.3 times slower

About

Managed C# code for the Pokemon Go API request signature encryption (port of "encrypt.c" from the r/pokemongodev efforts)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages