GENERIC: encode ( in-bytes cipher -- out-bytes ) GENERIC: decode ( in-bytes cipher -- out-bytes ) GENERIC: reverse-cipher ( encoder -- decoder ) GENERIC: encode-file ( out-path in-path cipher -- ) GENERIC: decode-file ( out-path in-path cipher -- ) M: cipher decode reverse-cipher encode ; : change-file ( out-path in-path quot' -- ) [ binary file-contents ] dip call swap binary set-file-contents ; M: cipher encode-file '[ _ encode ] change-file ; M: cipher decode-file '[ _ decode ] change-file ;