-->

  • brute-force attack in python

     

    brute-force attack in python



    In a brute-force attack, the advisory attempts to decrypt the ciphertext by using every possible key. If the key is small enough, a brute-force attack can be successful in a matter of minutes. In fact, if the keys are around 222, we can write a Python script to crack the password utilizing brute force. For your estimation purposes, when it comes to brute-force attacks, the following helps you ballpark
    the amount of security you get for various size problems:


    • A key space/message space of 264 is enough for a couple hours of security.
    • A key space/message space of 2128 is enough for several decades of pre- quantum security.
    • A key space/message space of 2256 is enough for several decades of post- quantum security.




    The following is an example of code that will generate a four-digit PIN and then loop through the iterations using brute force to determine the password:



    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/implementing-cryptography/cert]
    └─$ cat brute-crypt.py     
    #!/usr/bin/python3
    
    import random
    generated_password = str(random.randint(0, 9999))
    #print(generated_password)
    
    for i in range(10000):
        Trial = str(i)
        if Trial == generated_password:
           print('Found password: ' + generated_password)
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/implementing-cryptography/cert]
    └─$ 
    
    



    brute-force attack in python



    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/implementing-cryptography/cert]
    └─$ 
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/implementing-cryptography/cert]
    └─$ python3 brute-crypt.py 
    Found password: 8737
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/implementing-cryptography/cert]
    └─$ python3 brute-crypt.py
    Found password: 6227
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/implementing-cryptography/cert]
    └─$ python3 brute-crypt.py
    Found password: 433
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/implementing-cryptography/cert]
    └─$ 
    
    
    



    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

  • 0 comments:

    Post a Comment

    For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.