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

UnknownWhere/pokemongo-encrypt-sharp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 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

Performing 3000 encryption operations with both native and managed functions...
native took 0.1281 ms per round, total: 384.36 ms
managed took 2.478 ms per round, total: 7434.18 ms
managed is 19.34 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

  • C# 100.0%