Refactor to cipher_squar.rb