translated SMSSecurity to Swift