[python] Greatest Common Denominator

I am studying how to calculate RSA, and in the way the formula has something related to GCD, not only in RSA also in Affine Cipher also has a condition that gcd(a, b) = 1 when choosing a and b as keys. So this is a code snippet after I have learned about gcd. The … Continue reading [python] Greatest Common Denominator

[python]Affine cipher

I am studying for examination, and i could not actually find the solution by hand while doing decryption, basically i felt inverse modulus is very hard to understand (using the Euclidean algorithm). I am still trying and practising by hand and I have decided to write a python script to help me verify my decryption … Continue reading [python]Affine cipher

[python] Diffie Hellman key exchange demo…

Ok, I was studying my examination and I was directed to watch this video to understand how Diffie Hellman (DH) key exchange works mathematically, the video was really good, concise and easy to understand, so to add spice to my study (study for examination is the world's most boring thing to do) I wrote a … Continue reading [python] Diffie Hellman key exchange demo…

[python]Understanding the fields of Ether and ARP in Scapy

To find out the fields of Ether There is a ls method which can be used to show the fields of Ether. This ls method is used to find out the fields that i can put in values. This shows there are three fields, to send a broadcast frame, I need to put in ff:ff:ff:ff:ff:ff … Continue reading [python]Understanding the fields of Ether and ARP in Scapy

[python]Capture live hosts with scapy using threading

This script borrows the code from Python Code by far I felt this code is the best in terms of structure, the author structured blocks of code with explanation, although oddly Pycharm fails to resolve Ether and ARP functions from scapy.all Pycharm also fails to resolve the arguments of SRP method, such as the verbose … Continue reading [python]Capture live hosts with scapy using threading

[python]regex to find mac address

This is my interface mac address To search for the substring from the lines of string i use the search method. This is the pattern pattern = r"([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}" And in order to return the substring only use the group() method. If you print the re.search result without using group method you will get the entire … Continue reading [python]regex to find mac address