(ct, key)
return pt
r"""
    Performs the Bifid cipher decryption on ciphertext ``ct``, and returns the plaintext.

    This is the version of the Bifid cipher that uses the `6 \times 6` Polybius square.
    Assumes alphabet of symbols is "A", ..., "Z", "0", ..., "9".

    INPUT:

        ``ct``: ciphertext string (digits okay)

        ``key``: short string for key (no repetitions, digits okay)

    OUTPUT:

        plaintext from Bifid cipher (all caps, no spaces)

    Examples
    ========

    >>> from sympy.crypto.crypto import encipher_bifid6, decipher_bifid6
    >>> key = "encrypt"
    >>> pt = "meet me on monday at 8am"
    >>> encipher_bifid6(pt, key)
    'HNHOKNTA5MEPEGNQZYG'
    >>> ct = "HNHOKNTA5MEPEGNQZYG"
    >>> decipher_bifid6(ct, key)
    'MEETMEONMONDAYAT8AM'
r"""
    Performs the Bifid cipher decryption on ciphertext ``ct``, and returns the plaintext.
r Performs the Bifid cipher decryption on ciphertext ct and returns the plaintext .
def decipher_bifid6(ct, key):
    r"""
    Performs the Bifid cipher decryption on ciphertext ``ct``, and returns the plaintext.

    This is the version of the Bifid cipher that uses the `6 \times 6` Polybius square.
    Assumes alphabet of symbols is "A", ..., "Z", "0", ..., "9".

    INPUT:

        ``ct``: ciphertext string (digits okay)

        ``key``: short string for key (no repetitions, digits okay)

    OUTPUT:

        plaintext from Bifid cipher (all caps, no spaces)

    Examples
    ========

    >>> from sympy.crypto.crypto import encipher_bifid6, decipher_bifid6
    >>> key = "encrypt"
    >>> pt = "meet me on monday at 8am"
    >>> encipher_bifid6(pt, key)
    'HNHOKNTA5MEPEGNQZYG'
    >>> ct = "HNHOKNTA5MEPEGNQZYG"
    >>> decipher_bifid6(ct, key)
    'MEETMEONMONDAYAT8AM'

    """
    A = alphabet_of_cipher() + [str(a) for a in range(10)]
    # first make sure the letters are capitalized
    # and text has no spaces
    key = uniq(key)
    key0 = [x.capitalize() for x in key if x.isalnum()]
    ct0 = [x.capitalize() for x in ct if x.isalnum()]
    # create long key
    long_key = key0 + [x for x in A if not(x in key0)]
    n = len(ct0)
    # the fractionalization
    pairs = flatten([[long_key.index(x)//6, long_key.index(x) % 6] for x in ct0])
    tmp_plain = flatten([[pairs[i], pairs[n + i]] for i in range(n)])
    pt = "".join([long_key[6*tmp_plain[2*i] + tmp_plain[2*i + 1]] for i in range(n)])
    return pt
def decipher_bifid6 ( ct , key ) : A = alphabet_of_cipher ( ) + [ str ( a ) for a in range ( 10 ) ] # first make sure the letters are capitalized # and text has no spaces key = uniq ( key ) key0 = [ x . capitalize ( ) for x in key if x . isalnum ( ) ] ct0 = [ x . capitalize ( ) for x in ct if x . isalnum ( ) ] # create long key long_key = key0 + [ x for x in A if not ( x in key0 ) ] n = len ( ct0 ) # the fractionalization pairs = flatten ( [ [ long_key . index ( x ) // 6 , long_key . index ( x ) % 6 ] for x in ct0 ] ) tmp_plain = flatten ( [ [ pairs [ i ] , pairs [ n + i ] ] for i in range ( n ) ] ) pt = "" . join ( [ long_key [ 6 * tmp_plain [ 2 * i ] + tmp_plain [ 2 * i + 1 ] ] for i in range ( n ) ] ) return pt