Thanks for your bug report. This is by design. $encode() originally only supported three parameters, with the last two parameters being optional. It was then extended to handle encryption that required different parameter types and different numbers of parameters. However, it was requested that support for N be maintained as the last parameter in all cases. By not specifying the s or i switches, you are telling encode that you are not providing a fourth parameter for a salt or iv. In this case, the fourth parameter becomes N.