You are using DES but are specifying the key size as: kCCKeySizeAES256
in the call to: CCCrypt
.
There are so many things wrong with this code from a security standpoint, don't use this in a real app. This is no longer best practice. Among other things the password should be converted to key with a Password-Based Key Derivation Function such as PBKDF2. Also using DES and ECB mode is a weaknesses.