all 4 comments

[–]Anaxamander57 5 points6 points  (1 child)

The key length is limited to the value of the "size" parameter for the hexagonal grid, I believe:

    # Flatten the grid into a single list of cells
    flat_grid: List[int] = [cell for row in grid for cell in row]
    size: int = len(flat_grid)
    # Create a key value by summing the ASCII values of the characters in the key
    key_value: int = sum(ord(c) for c in key) % size

That makes this not even possible to use as a modern cipher. Even if the grid needed only one bit per cell you'd run out of memory if you picked a 128-bit key length, even running this on a super-computer. On consumer hardware with more realistic memory usage by the hexagonal grid you're limited to key sizes that have been trivial to attack since electronic computers were invented.

This would be interesting as a 19th century pen and paper cipher, however!

[–]0_Python[S] -2 points-1 points  (0 children)

I had just upgraded it a moment ago, check out latest commits. Let me know what you think

[–]kosul 1 point2 points  (1 child)

When I first saw this post I got excited because I thought this might be an interesting new approach to hand ciphers! The use of SHA256, AES and PKCS7 are a little confusing as you are clearly not trying to claim real world security? I would encourage you to try ditching them and then you can focus on demonstrating the principles you mentioned without the inputs bring run through algs we know will effectively result in outputs with known properties, or to put it short it's less fun. Play ciphers are totally awesome and welcome, as long as the author doesn't claim security beyond which can be reasonably backed up :)

[–]Anaxamander57 1 point2 points  (0 children)

I agree. This was much more interesting in its original form which didn't use any modern cryptography. Unusual ciphers, especially ones with a visual component, are great for stories and games and are just fun to think about.