Journal of development Sorting Thoughts and more…

Native Base64 encoding in iOS7

Posted on Mar 1, 2014 in iOS, Programming

Finally, iOS 7 lets you easy encoding and decoding Base64 string objects without third-party libs. Here is a little unit test which illustrates the encoding and decoding of a NSString object:

- (void) testBase64Encoding
    // NSString --> NSData --> Base64 NSString
    NSString *rawString = @"a test string";
    NSData *rawData = [rawString dataUsingEncoding:NSUTF8StringEncoding];
    NSString *base64String = [rawData base64EncodedStringWithOptions:0];

    XCTAssertEqualObjects(@"YSB0ZXN0IHN0cmluZw==", base64String, @"wrong base64 string");
    // Base64 NSString --> NSData --> NSString
    NSData *dataFromString = [[NSData alloc] initWithBase64EncodedString:base64String options:0];
    NSString *testResult = [NSString stringWithUTF8String:[dataFromString bytes]];
    XCTAssertEqualObjects(rawString, testResult, @"wrong raw text");
Read More

Apple explains security concepts

Posted on Mar 1, 2014 in iOS, Security

Apple explains his security concepts behind iOS in a 33 page long white paper.

• System security: The integrated and secure software and hardware that are the platform for iPhone, iPad, and iPod touch.

• Encryption and data protection: The architecture and design that protect user data if the device is lost or stolen, or if an unauthorized person attempts to use or modify it.

• App security: The systems that enable apps to run securely and without compromis- ing platform integrity.

• Network security: Industry-standard networking protocols that provide secure authentication and encryption of data in transmission.

• Internet services: Apple’s network-based infrastructure for messaging, syncing, and backup.

• Device controls: Methods that prevent unauthorized use of the device and enable it to be remotely wiped if lost or stolen.

Security White Paper (PDF)


Read More

Apple updates “Secure Coding Guide”

Posted on Feb 20, 2014 in iOS, Mac, Programming, Security


Security is not something that can be added to software as an afterthought; just as a shed made out of cardboard cannot be made secure by adding a padlock to the door, an insecure tool or application may require extensive redesign to secure it. You must identify the nature of the threats to your software and incorporate secure coding practices throughout the planning and development of your product.

This chapter explains the types of threats that your software may face. Other chapters in this document describe specific types of vulnerabilities and give guidance on code hardening techniques to fix them.

The latest update of Apple’s “Secure Coding Guide” contains following changes:

  • Added information about non-executable stacks and heaps, address space layout randomization, injection attacks, and cross-site scripting.


Read More

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.