(string, word_size, plain_chars='')
| 392 | # plain_chars |
| 393 | # - characters that you do not want to encrypt |
| 394 | def encrypt_str(string, word_size, plain_chars=''): |
| 395 | byte_obj = string.encode(CODEC, 'ignore') |
| 396 | encode_on = set(byte_obj).difference(set(plain_chars.encode())) |
| 397 | sudoku_key = make_sudoku_key(encode_on, word_size) |
| 398 | boot_strap = make_boot_strap(sudoku_key) |
| 399 | cyphertext = encrypt(byte_obj, sudoku_key, boot_strap)[0] |
| 400 | # return encrypted string, key, and original bootstrap |
| 401 | return cyphertext.decode(CODEC, 'ignore'), sudoku_key, boot_strap |
| 402 | |
| 403 | def grid_size(string, word_size, plain_chars): |
| 404 | encode_on = set(string.encode()).difference(set(plain_chars.encode())) |
no test coverage detected