Skip to content

Instantly share code, notes, and snippets.

View vijayanandrp's full-sized avatar
👑

Vijay Anand Pandian vijayanandrp

👑
View GitHub Profile
@vijayanandrp
vijayanandrp / How to learn Python in a 15 Minutes !! Believe its very cool language to have fun and learn .py
Created June 15, 2017 22:27
How to learn Python in a 15 Minutes !! Believe its very cool language to have fun and learn :)
#!/usr/bin/env python
# I have learned these codes from Learning Python O'reilly
# Python 2.7
"""
#! is often called hash bang or shebang
/user/bin/python - path of the python executable
#!/usr/bin/python - Unix Styled Executable Scripts (If u know exact path of the python binary)
@vijayanandrp
vijayanandrp / How to write Class in Python with examples.py
Created June 15, 2017 22:29
How to write Class in Python with examples
#!/usr/bin/env python
class Worker:
def __init__(self, name, pay):
self.name = name
self.pay = pay
def last_name(self):
return self.name.split()[-1]
@vijayanandrp
vijayanandrp / Writeup for InCTF 2014 - Crypto 200 - Solved RSA 4096 bit .sh
Created June 15, 2017 22:34
Writeup for InCTF 2014 - Crypto 200 - Solved RSA 4096 bit
root@Vijay:# openssl rsa -pubin -in pub.pem -text -noout -modulus
Public-Key: (4096 bit)
Modulus:
00:d1:0b:a0:e9:cd:6d:d6:c3:89:5f:cd:f4:17:db:
21:e5:81:22:60:89:c6:c7:58:7f:c4:1b:3d:78:df:
f5:2c:0f:8c:29:dc:6b:e9:fc:cf:31:68:32:e6:ff:
6f:f0:49:6e:9e:56:6e:cb:c1:31:06:4e:b8:47:5d:
6c:1b:c8:28:be:4a:f4:54:ad:62:cb:f0:d1:d2:cd:
5a:59:8a:24:1c:52:b1:6d:8e:e1:da:0c:a9:cc:56:
30:3c:d0:70:71:0e:6c:18:1f:2a:31:c6:88:7e:52:
@vijayanandrp
vijayanandrp / Writeup for InCTF 2014 - Crypto 200 - Solved RSA 4096 bit .py
Created June 15, 2017 22:35
Writeup for InCTF 2014 - Crypto 200 - Solved RSA 4096 bit
#!/bin/python
import gmpy
n = 0x00d10ba0e9cd6dd6c3895fcdf417db21e581226089c6c7587fc41b3d78dff52c0f8c29dc6be9fccf316832e6ff6ff0496e9e566ecbc131064eb8475d6c1bc828be4af454ad62cbf0d1d2cd5a598a241c52b16d8ee1da0ca9cc56303cd070710e6c181f2a31c6887e52cf14bd76f62580a84692f88198a938490fb2de1941b11085833dedca16673f4ae54be60fe0da6624a53db232dca6c5887d723c7739c476ef306019a057f1c6be37a5b820d0919acffd1863d22c6fa730fe12e815359d68a4ece1c01ef7b0ecd95991b3d971d00927995ed66ed6c9933644c4f99ec752809eaf731e69c5c0f9b034e1b8330fefd40590c46fa179614f7ad28cd18b997369182f46f9e9ba2548c65380e53e22c99beaa69bf6f863874530bdce9a68ee6afba4e9ae0781be5b3df1a517c57ec1b52b4b84b71863a88a35f1c0df0a1f8ee36c9161d2ef60472a129db81666223edd07f3e9d1da4bfdd2171dbe58a036804deffd8fd58eb57a2a454b25c5de925a1654d5fe670204b840129b8bc5a2d397faf2157a8bb209a27aff89b2f8bf18abda5371e0c1cf3d68c20b5e3e195f6f6312a3f8ef9788cafb7661b79af752159f885017bde86c7a2eb34e277dac367d9f5633c5900ad115ef4c8fae5328da215cb220b8aefb09e302628a2be0569ee7dc171ef3147c6ace610271e06d5ba71403d3
@vijayanandrp
vijayanandrp / Write up for InCTF 2014 - Crypto 200 - Solved RSA 4096 bit using low public exponent attack.txt
Created June 15, 2017 22:38
Write up for InCTF 2014 - Crypto 200 - Solved RSA 4096 bit using low public exponent attack
11657667992152384389168970007935564620544078223989911116124095315088239681126594015781938080477630692915497593321366093615015306163688656393156198882654127506116466608834490674480387607410167266362059980939450825093071957288196553216860521023077321644076523737128658172831409622651074862
Never use a small public exponent in RSA keys. The recommended exponent is 65537. The key for this level is weakrsakey.
"""
ciphertext = pow(plaintext, 3) % modulus
# 'ciphertext' is the remainder, so all we need to know to take the cubic root is the quotient 'k'
@vijayanandrp
vijayanandrp / Creating a public key using openssl.sh
Created June 15, 2017 22:43
Creating a public key using openssl
root@Vijay:# openssl rsa -inform PEM -text -pubin -in publickey.pem -modulus
Public-Key: (704 bit)
Modulus:
00:e1:34:18:93:fe:6e:68:16:ce:c8:a9:70:a3:9c:
00:fa:54:7c:7d:a2:cd:ed:ab:0a:62:b9:1c:46:51:
a8:3f:96:38:0b:cf:ae:e2:6f:7e:86:61:07:90:63:
89:42:1b:1e:68:d0:a1:7a:ad:c9:87:0b:98:58:e9:
56:28:6e:39:99:e9:8c:ec:98:81:53:4a:c7:72:ae:
@vijayanandrp
vijayanandrp / Write up for InCTF 2014 - Crypto 300 - Solved RSA-704 bit using known factors .txt
Created June 15, 2017 22:45
Write up for InCTF 2014 - Crypto 300 - Solved RSA-704 bit using known factors
I have just pasted it to save my time.
One way to do this is to generate a DER encoded key using
OpenSSL's asn1parse command's -genconf option.
You'll need to construct an input file for
asn1parse -genconf to produce an RSA key in the standard format (per RFC 3447).
The syntax for asn1parse -genconf is given here:
http://www.openssl.org/docs/crypto/ASN1_generate_nconf.html and indeed,
@vijayanandrp
vijayanandrp / Write up for InCTF 2014 - Crypto 300 - Solved RSA-704 bit using known factors .sh
Created June 15, 2017 22:46
Write up for InCTF 2014 - Crypto 300 - Solved RSA-704 bit using known factors
root@Vijay:# cat c4.der
asn1=SEQUENCE:rsa_key
[rsa_key]
version=INTEGER:0
modulus=INTEGER:74037563479561712828046796097429573142593188889231289084936232638972765034028266276891996419625117843995894330502127585370118968098286733173273108930900552505116877063299072396380786710086096962537934650563796359
pubExp=INTEGER:65537
privExp=INTEGER:33307131606083860709359654688809620595435784183304180784765475180353602262817269247014766169336517530471801339770560112997370264392886185538231911908428012730752492181217073681726139624557304859252988692991966953
p=INTEGER:9091213529597818878440658302600437485892608310328358720428512168960411528640933367824950788367956756806141
@vijayanandrp
vijayanandrp / Write up for InCTF 2014 - Stegnography 400 solved using python .py
Created June 15, 2017 22:53
Write up for InCTF 2014 - Stegnography 400 solved using python
import os,sys
import Image
modi_bin = Image.open("modi.png").convert('RGB')
bin = ''
R = open('r.txt','w')
G = open('g.txt','w')
B = open('b.txt','w')
@vijayanandrp
vijayanandrp / How to do Python Speech recognition project like Jarvis in Mac OS X.py
Created June 15, 2017 23:04
How to do Python Speech recognition project like Jarvis in Mac OS X?
"""Library for performing speech recognition with the Google Speech Recognition API."""
"""Library for performing speech recognition with the Google Speech Recognition API."""
__author__ = 'Anthony Zhang (Uberi)'
__version__ = '1.1.2'
__license__ = 'BSD'
import io, os, subprocess, wave
import math, audioop, collections
import json, platform, time