Caesar Cipher in Swift

If you are at all interested in encryption and its history, then you undoubtedly heard of Caesarian cipher. The Caesar cipher was developed and used by Julius Caesar to encrypt messages between him and his generals. The mechanics behind it is to encrypt plain text by shifting each letter in the plaintext a certain number of places down the alphabet. For example, we could shift alphabet down 3 letters so that A would become D, B would become C… A would become X, etc.

I should mention that Caesarian cipher is extremely easy to decrypt. Don’t use it to encrypt sensitive data. However, I would consider it an “additional step” to already secured information. For example, when storing access token in keychain, we could encrypt it using Caesarian cipher to provide an additional layer of security. After all, it is possible to get information stored in a keychain especially if you know / get a hold of / a Mac password (this assumes keychain being synched).

Continue reading “Caesar Cipher in Swift”

Caesar Cipher in Swift

Mutable Function Parameters

Today I decided to take a look at the upcoming Swift 3.0 changes. If you are interested in reading about implemented proposals, please see Swift Evolution page on Github. This article is in addition to the article I wrote about Swift 2.2 changes that can be found here.

SE-0003: Removing var from Function Parameters – is the one I want to talk about. Function parameters, by default, are constants. However, it was possible to declare the parameter as a variable.

Continue reading “Mutable Function Parameters”

Mutable Function Parameters