Uses the 05AB1E encoding for the Caesar-shifting.
Encoder:
žĆDII(._kI+è
Input order as string, shift, (optional Caesar-shift). I/O of the strings as character-list.
Decoder:
žĆDIkI-èI._
Input order as string, (optional Caesar-shift), shift. I/O of the strings as character-list.
Explanation:
# ENCODER:
žĆ # Push the 05AB1E codepage
D # Duplicate it
I # Push the first character-list input
I # Push the second shift integer
( # Negate it
._ # Shift the character-list that many times towards the left
k # Get the index of each character in the duplicated codepage
I # Push the second shift input again or the optional third Caesar-shift input
+ # Add it to each index
è # And index it into the 05AB1E codepage
# (after which the resulting character-list is output implicitly as result)
# DECODER:
žĆ # Push the 05AB1E codepage
D # Duplicate it
I # Push the first character-list input
k # Get the index of each in the duplicated codepage
I # Push the optional Caesar-shift or shift integer
- # Subtract it from each index
è # Index it into the 05AB1E codepage
I # Push the second/third shift integer
._ # And rotate the character-list that many times towards the left
# (after which the resulting character-list is output implicitly as result)