In progress proc XOR args { set work [lindex $args 0] set args [lrange $args 1 end] foreach item $args { set work [expr $work ^ $item] } return $work } proc leftshift {current polynominals} { set selected [list] foreach selector $polynominals { lappend selected [string index $current $selector] } set new_bit [XOR $selected] return "[string range $current 1 end][set new_bit]" } [Category Cryptography]