Navicat 导出ncx文件 密码解密

  1. 安装扩展
    1
    pip install pycryptodmex
  2. 替换‘需要解码的字符串’,后执行Python代码
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    from Cryptodome.Cipher import AES

    def decrypt_navicat(data, key, iv):
    cipher = AES.new(key.encode(), AES.MODE_CBC, iv.encode())
    decrypted_data = cipher.decrypt(bytes.fromhex(data))
    unpadded_data = decrypted_data[:-decrypted_data[-1]].decode('utf-8')
    return unpadded_data

    if __name__ == '__main__':
    encrypted_password = '需要解码的字符串'
    key = 'libcckeylibcckey'
    iv = 'libcciv libcciv '
    decrypted_password = decrypt_navicat(encrypted_password, key, iv)
    print(decrypted_password)