Skip to content

Instantly share code, notes, and snippets.

View mevangelista-alvarado's full-sized avatar
💭
Working and learning at @Prescrypto and UNAM

M mevangelista-alvarado

💭
Working and learning at @Prescrypto and UNAM
View GitHub Profile
@mevangelista-alvarado
mevangelista-alvarado / virtualenv.md
Last active July 13, 2018 21:31
Small description for use virtual environment for OS X and Linux

Virtual Environment

Create

To start, first create a directory

    mkdir directory_name
@mevangelista-alvarado
mevangelista-alvarado / test_rsa.py
Created July 3, 2018 17:24
Test of the rsa library from python and compatible with the signature of jsrsasing library from javascript
import rsa
import base64
import binascii
def load_puk(name_file):
name_file = name_file + '.pem'
with open(name_file, 'rb') as file:
PublicKey = file.read()
puk = rsa.PublicKey.load_pkcs1_openssl_pem(PublicKey)
return puk
@mevangelista-alvarado
mevangelista-alvarado / cut_string.py
Created June 28, 2018 21:38
This a test for cut a phrase with a limit, without cutting words
# Variables
test = u'Hola a todo el mundo' # Enter a phrase
lenght = 10 # Enter a number
test_list = test.split()
i = len(test_list)
while i<=len(test_list):
phrase = " ".join(list[0:i])
if len(phrase)<lenght: