Skip to content

Instantly share code, notes, and snippets.

@BitPuffin
Last active August 29, 2015 13:56
Show Gist options
  • Save BitPuffin/9250534 to your computer and use it in GitHub Desktop.
Save BitPuffin/9250534 to your computer and use it in GitHub Desktop.
NSLog(@"WHAT DOES THIS: %@ LOOK LIKE IN BASE?", [NSString stringWithFormat:@"%@:%@", user, password]);
NSData *base64Data = [[NSString stringWithFormat:@"%@:%@", user, password] dataUsingEncoding:NSUTF8StringEncoding];
NSString *base64 = [base64Data base64Encoding];
NSLog(@"ALL YOUR BASE ARE BELONG TO US 64: %@", base64);
# the logs
2014-02-27 14:55:52.160 Hivetest[1257:907] WHAT DOES THIS: fakeuser:fakepassword LOOK LIKE IN BASE?
2014-02-27 14:55:52.160 Hivetest[1257:907] ALL YOUR BASE ARE BELONG TO US 64: ZmFrZXVzZXI6ZmFrZXBhc3N3b3Jk
#on the terminal
% echo fakeuser:fakepassword | base64
ZmFrZXVzZXI6ZmFrZXBhc3N3b3JkCg==
% echo ZmFrZXVzZXI6ZmFrZXBhc3N3b3Jk | base64 -D # Decoding the one from the xcode logs
fakeuser:fakepassword%
% echo ZmFrZXVzZXI6ZmFrZXBhc3N3b3JkCg== | base64 -D # Decoding the one from the terminal
fakeuser:fakepassword
%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment