Git Product home page Git Product logo

how-does-navicat-encrypt-password's Introduction

How Does Navicat Encrypt Password?

This repo will tell you how Navicat encrypts password and offer a tool to reveal passwords encrypted by Navicat.

1. What is Navicat?

Navicat is a series of graphical database management and development software produced by PremiumSoft CyberTech Ltd. for MySQL, MariaDB, Oracle, SQLite, PostgreSQL and Microsoft SQL Server.

It has an Explorer-like graphical user interface and supports multiple database connections for local and remote databases. Its design is made to meet the needs of a variety of audiences, from database administrators and programmers to various businesses/companies that serve clients and share information with partners.

2. What does indicate that Navicat encrypts password?

If you use Navicat to manage one of your databases, the first thing you should do is to create a connection to the database. So that means you should fill textboxes on the window showed below with the database's information like Host name, User name, Password and so on.

If you check "Save Password", after you click "Ok" button, Navicat will encrypt the password and then save the connection configuration, containing encrypted password, in Windows Registry. The exact path is showed below:

Database Type Path
MySQL HKEY_CURRENT_USER\Software\PremiumSoft\Navicat\Servers\<your connection name>
MariaDB HKEY_CURRENT_USER\Software\PremiumSoft\NavicatMARIADB\Servers\<your connection name>
MongoDB HKEY_CURRENT_USER\Software\PremiumSoft\NavicatMONGODB\Servers\<your connection name>
Microsoft SQL HKEY_CURRENT_USER\Software\PremiumSoft\NavicatMSSQL\Servers\<your connection name>
Oracle HKEY_CURRENT_USER\Software\PremiumSoft\NavicatOra\Servers\<your connection name>
PostgreSQL HKEY_CURRENT_USER\Software\PremiumSoft\NavicatPG\Servers\<your connection name>
SQLite HKEY_CURRENT_USER\Software\PremiumSoft\NavicatSQLite\Servers\<your connection name>

The following is an example:

3. How does Navicat encrypt password?

See here.

4. How to use the sample code in python3 folder?

  • Please make sure that you have Python3.

  • Please make sure that you have pycryptodome module if you want to use NavicatCipher.py and NcxReader.py.

    You can install pycryptodome module by command:

    $ pip install pycryptodome
  • Please make sure that you have pypiwin32 module if you want to use ShowNavicat.py.

    You can install pypiwin32 module by command:

    $ pip install pypiwin32
  1. NavicatCipher.py

    Usage:
        NavicatCrypto.py <enc|dec> [-ncx] <plaintext|ciphertext>
    
        <enc|dec>                "enc" for encryption, "dec" for decryption.
                                 This parameter must be specified.
    
        [-ncx]                   Indicate that plaintext/ciphertext is
                                 prepared for/exported from NCX file.
                                 This parameter is optional.
    
        <plaintext|ciphertext>   Plaintext string or ciphertext string.
                                 NOTICE: Ciphertext string must be a hex string.
                                 This parameter must be specified.
    

    Example:

    $ ./NavicatCipher.py enc "This is a test"
    0EA71F51DD37BFB60CCBA219BE3A
    
    $ ./NavicatCipher.py dec 0EA71F51DD37BFB60CCBA219BE3A
    This is a test
    
    $ ./NavicatCipher.py enc -ncx "This is a test"
    B75D320B6211468D63EB3B67C9E85933
    
    $ ./NavicatCipher.py dec -ncx B75D320B6211468D63EB3B67C9E85933
    This is a test
    
    $ python3
    Python 3.6.7 (default, Oct 22 2018, 11:32:17)
    [GCC 8.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from NavicatCipher import *
    >>> cipher = Navicat12Crypto()
    >>> cipher.EncryptString('This is a test')
    '0EA71F51DD37BFB60CCBA219BE3A'
    
    >>> cipher.DecryptString('0EA71F51DD37BFB60CCBA219BE3A')
    'This is a test'
    
    >>> cipher.EncryptStringForNCX('This is a test')
    'B75D320B6211468D63EB3B67C9E85933'
    
    >>> cipher.DecryptStringForNCX('B75D320B6211468D63EB3B67C9E85933')
    'This is a test'
  2. NcxReader.py

    Show database servers' information inside *.ncx file.

    Usage:
        NcxReader.py <Path to ncx file>
    

    Example:

    $ ./NcxReader ~/connectioms.ncx
    -----------------xxxxxxxxxxxx--------------------
    Connection Type  = MYSQL
    Host             = localhost
    Port             = 3306
    UserName         = root
    Password         = 12345678
    
    ------------------yyyyyyyyyy---------------------
    Connection Type  = MYSQL
    Host             = example.com
    Port             = 3306
    UserName         = server
    Password         = 0000000000
    
    ...
    ...
    ...
  3. ShowNavicat.py

    Just run it in Windows. It will list all Navicat configurations inside Windows Registry.

    Example:

    >ShowNavicat.py
    +--------------------------------------------------+
    |                   MySQL Server                   |
    +--------------------------------------------------+
    
    Host:              example.com
    Port:              3306
    Username:          server
    Password:          0000000000
    
    ...
    ...
    
    +--------------------------------------------------+
    |                  MariaDB Server                  |
    +--------------------------------------------------+
    
    ...
    ...
    
    +--------------------------------------------------+
    |                  MongoDB Server                  |
    +--------------------------------------------------+
    
    ...
    ...
    
    ...
    ...

how-does-navicat-encrypt-password's People

Contributors

cmbsolutions avatar doublelabyrinth avatar hypersine avatar juliardi avatar spalekg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

how-does-navicat-encrypt-password's Issues

run NcxReader.py raise a error

python3 .\NcxReader.py c:\Users\brucm\Desktop\connections.ncx
---------------------test-jt----------------------
Connection Type  = MYSQL
Host             = 10.10.10.10
Port             = 3306
UserName         = root
Traceback (most recent call last):
  File "C:\Apps\how-does-navicat-encrypt-password\python3\NcxReader.py", line 114, in <module>
    exit(Main(len(sys.argv), sys.argv))
  File "C:\Apps\how-does-navicat-encrypt-password\python3\NcxReader.py", line 105, in Main
    print('%-16s = %s' % ('Password', TryDecrypt(cipher, conn.attrib['Password'])))
KeyError: 'Password'

An issue about the version of MacOS

Hi, I really appreciate for your contribution for this project.

Do you know what I should do in this case?

Screen Shot 2020-02-29 at 2 36 01 AM

I remember there was a branch called mac for the previous repo, but I am unable to find it for the current one.

OS: macOS Catalina Version 10.15.3

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf4 in position 0: invalid continuation byte

MacBook-Pro:python3 xueliang$ python NavicatCryptoHelper.py -d "25C4********************************************************98D9"
Traceback (most recent call last):
  File "NavicatCryptoHelper.py", line 15, in <module>
    print(NavicatCipher.DecryptString(sys.argv[2]))
  File "/Users/xueliang/Downloads/how-does-navicat-encrypt-password-master/how-does-navicat-encrypt-password-master/python3/NavicatCrypto.py", line 80, in DecryptString
    return Result.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf4 in position 0: invalid continuation byte
MacBook-Pro:python3 xueliang$ 

I run the command above, but an exception occurred(I have masked some character with *, full string was from navicat connections.ncx file).

run python NavicatCipher.py enc -ncx "This is a test" has some error

I use python version 3.8.2

$ python NavicatCipher.py enc -ncx "This is a test"
Traceback (most recent call last):
File "NavicatCipher.py", line 111, in
exit(Main(len(sys.argv), sys.argv))
File "NavicatCipher.py", line 100, in Main
print(Navicat12Crypto().EncryptStringForNCX(argv[3]))
File "NavicatCipher.py", line 63, in EncryptStringForNCX
padded_plaintext = Padding.pad(s.encode('ascii'), AES.block_size, stype = 'pkcs7')
TypeError: pad() got an unexpected keyword argument 'stype'

$ python NavicatCipher.py dec -ncx B75D320B6211468D63EB3B67C9E85933
Traceback (most recent call last):
File "NavicatCipher.py", line 111, in
exit(Main(len(sys.argv), sys.argv))
File "NavicatCipher.py", line 102, in Main
print(Navicat12Crypto().DecryptStringForNCX(argv[3]))
File "NavicatCipher.py", line 69, in DecryptStringForNCX
return Padding.unpad(padded_plaintext, AES.block_size, stype = 'pkcs7').decode('ascii')
TypeError: unpad() got an unexpected keyword argument 'stype'

License ?

I want to use my Java implementation based on your Python and VB.NET implementation (I've send the pull request at #2, please review them), but I am not sure if it's allowed considering that you are not listing any License statement in this repository.
So, would you consider adding a license to this repository?
Thank you

Typo in NcxReader.py

You have a typo in line 69 of NcxReader.py

it is shown:

        return Padding.unpad(padded_plaintext, AES.block_size, stype = 'pkcs7').decode('ascii')

it should be:

        return Padding.unpad(padded_plaintext, AES.block_size, style = 'pkcs7').decode('ascii')

But check line 63 too, about the same typo error (stype = 'pkcs7' but should be style = 'pkcs7'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.