Latest 0.0.2
License MIT
Platforms ios 8.0, osx 10.9

CocoaPods Compatible

TPObfuscatedString is a simple extension for String in Swift.
It allows you to obfuscate hardcoded Strings in your compiled binary.

To try it out, use the commandline strings.

This project is not supposed to be a copy of the library UAObfuscatedString!
TPObfuscatedString uses basic Swift code to improve security even more!


A big thank you to UrbanApps and their project UAObfuscatedString!
It is a great library and the initial spark for me to create this pure swift library.

How does it work?

TPObfuscatedString does not save any Strings to the compiled binary.
Actually it uses UnicodeScalars to find the correct letter!

Now Hackers won’t be able to extract strings from your binary anymore!


  • If you need help, use Stack Overflow.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, see Contributing section.


Via CocoaPods
To integrate TPObfuscatedString into your Xcode project using CocoaPods, specify it in your Podfile:

source ''
platform :ios, '8.0'

pod 'TPObfuscatedString'


  1. Add TPObfuscatedString.swift to your project.
  2. That’s it!


Using this library is very simple. First of all you need an empty String object.
For your convenience you can simply use the static object TPObStr which is nothing different than an empty String.

Every letter has a corresponding method name. These methods are case-sensitive!
Special character and numbers have a spelled out method.
All visible ASCII characters are supported by now!


This returns this string: This is an example text: Hi!


This kind of obfuscated is slower than a hardcoded value which is pulled from the binary/memory.
But you can combine this with a caching algorithm to fasten it up!
Also this library is only recommended for short strings!


I would appreciate it a lot to see you improving this library!
The easiest way to contribute is fork the repo and send me a pull request after you created your adaption.

Please be sure the project builds without any warnings or errors before submitting a pull request!

I will respond to you and merging your changes into the master project as soon as possible!


Philip Niedertscheider



TPLocalizedError is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "TPObfuscatedString",
    "version": "0.0.2",
    "license": "MIT",
    "summary": "Simple and basic string obfuscating - based on UAObfuscatedString by Matt Coneybeare",
    "homepage": "",
    "authors": {
        "Philip Niedertscheider": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    "source": {
        "git": "",
        "tag": "0.0.2"
    "source_files": "Source/**/*.swift"

Pin It on Pinterest

Share This