$encode is not consistent with how it handles the presence of an unused 4th parameter without the presence of either the 's' or 'i' switches which make use of it.

The behavior changes depending on the composition of the 4th parameter, but doesn't seem to be affected by whether or not the length is 8 or by the length of the text parameter. Most values for the 1st character return the 1 digit, but a few of them return $null, and there appears to always be at least one 1st digit character for each rest-of-string which allows the 4th parameter to be ignored, with encryption returning the same value as if only 3 parameters were used.

This example has several first-byte-values that return the normal value by ignoring the not-used 4th parameter, but many last-7 patterns return a normal value only for the hyphen or for only strings beginning with '1'.

//clear | var %i 1 | while (%i isnum 1-255) { echo -a when 1st char of param4 is $ $+ chr( %i ) returns -> $encode(text,cr,key, $+($chr(%i),1a34567)) | inc %i }

The behavior for binary variables is similar, except the cases which returned length '1' in the above example leave &binvar unchanged instead of being the number of characters written to it. Perhaps 45 being the length of encoding 1 block using a salt/iv and '1' being a common return value is related to why encoding is done as normal for many 4th parameters which begin with $chr(45) hyphen or a '1'.

//clear | var %i 1 | while (%i isnum 1-255) { bset -tc &binvar 1 BLOWFISH123 | var %result $encode(&binvar,bcr,key, $+($chr(%i),1a34567)) | echo -a when 1st char of param4 is $ $+ chr( %i ) returns -> result: %result output: $bvar(&binvar,1-).text  | inc %i }