Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>1) Source of Blowfish routines from David Madore: <a href="ftp://quatramaran.ens.fr/pub/madore/misc/blowfish.c">ftp://quatramaran.ens.fr/pub/madore/misc/blowfish.c</a></p> <p>Pls note that in this source .h part should be separated from the .c file.</p> <p>2) To use Pandora API we have to use the passwords given by its wiki page here: <a href="http://pan-do-ra-api.wikia.com/wiki/Json/5/partners">http://pan-do-ra-api.wikia.com/wiki/Json/5/partners</a></p> <p>Currently decrypt password is: <code>20zE1E47BE57$51</code></p> <p>3) Use this code snippet (standing on great programmers' shoulders) - original Pandora API implementation is here: <a href="https://github.com/alexcrichton/hermes">https://github.com/alexcrichton/hermes</a></p> <p>In AppDelegate.h (for simplicity)</p> <pre><code>#define PARTNER_DECRYPT "20zE1E47BE57$51" ... -(NSData*) PandoraDecrypt:(NSString*) string; </code></pre> <p>In AppDelegate.m</p> <pre><code>static char h2i[256] = { ['0'] = 0, ['1'] = 1, ['2'] = 2, ['3'] = 3, ['4'] = 4, ['5'] = 5, ['6'] = 6, ['7'] = 7, ['8'] = 8, ['9'] = 9, ['a'] = 10, ['b'] = 11, ['c'] = 12, ['d'] = 13, ['e'] = 14, ['f'] = 15 }; static void appendByte(unsigned char byte, void *_data) { NSMutableData *data = (__bridge NSMutableData*) _data; NSLog(@"pre: %@", data); [data appendBytes:&amp;byte length:1]; NSLog(@"post: %@", data); } -(NSData*) PandoraDecrypt:(NSString*) string { struct blf_ecb_ctx ctx; NSMutableData *mut = [[NSMutableData alloc] init]; Blowfish_ecb_start(&amp;ctx, FALSE, (unsigned char*) PARTNER_DECRYPT, sizeof(PARTNER_DECRYPT) - 1, appendByte, (__bridge void*) mut); const char *bytes = [string cStringUsingEncoding:NSASCIIStringEncoding]; int len = [string lengthOfBytesUsingEncoding:NSASCIIStringEncoding]; int i; for (i = 0; i &lt; len; i += 2) { NSLog(@"%c, %c, %d, %d", bytes[i], bytes[i+1], h2i[(int) bytes[i]] * 16, h2i[(int) bytes[i + 1]]); Blowfish_ecb_feed(&amp;ctx, h2i[(int) bytes[i]] * 16 + h2i[(int) bytes[i + 1]]); } Blowfish_ecb_stop(&amp;ctx); return mut; } </code></pre> <p>And you can use this like:</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSLog(@"%@", [NSString stringWithCString:[ [self PandoraDecrypt:@"aed5c110d793f850521a4dd3a56a70d9"] bytes] encoding:NSASCIIStringEncoding]); return YES; } </code></pre> <p>So it was mainly a research from my side, pls give credit to implementers of the Blowfish api and the pandora api ;-) Also my NSLogs are for research purpose, it highlights how the decryption works.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload