Skip to content

Instantly share code, notes, and snippets.

View EnzoDiazDev's full-sized avatar
📰
Blogging

Enzo EnzoDiazDev

📰
Blogging
View GitHub Profile
@EnzoDiazDev
EnzoDiazDev / vigenere_cipher.ts
Last active August 15, 2021 20:25
Vigenère Cipher using typescript in a funcional way
type CipherEquation = (Xi:number, Ki:number, L:number) => number;
const encoder = (Xi:number, Ki:number, L:number) => (Xi + Ki) % L;
const decoder = (Ci:number, Ki:number, L:number) => (Ci - Ki) >= 0 ? (Ci - Ki) % L : (Ci - Ki + L) % L;
function repeat_key(to_length:number, key):string {
if(key.length < to_length) {
return repeat_key(to_length, key.repeat(2));
} else {
return key.slice(0, to_length + 1);
@EnzoDiazDev
EnzoDiazDev / vigenere_refacored.ts
Last active August 15, 2021 19:46
vigenere with functions p5
function vigenere_cipher(alphabet:string, key:string): (str:string, equation:cipher_equation) => string {
const L = alphabet.length;
return function(str, equation) { // this is the previous 'vigenere_cipher' function but as an anonymous function.
const repeated_key = repeat_key(str.length, key);
return str
.split("")
.map((C, i) => {
const Ci = alphabet.indexOf(C);
const K = repeated_key[i];
@EnzoDiazDev
EnzoDiazDev / vigenere_p4.ts
Created August 14, 2021 20:16
vigenere with functions p4
const key = "password";
const alphabet = "abcdefghijklmnopqrstuvwxyz";
const L = alphabet.length;
type cipher_equation = (Xi:number, Ki:number, L:number) => number;
const encode_char = (Xi:number, Ki:number, L:number) => (Xi + Ki) % L;
const decode_char = (Ci:number, Ki:number, L:number) => (Ci - Ki) >= 0 ? (Ci - Ki) % L : (Ci - Ki + L) % L;
function repeat_key(length:number):string {
let new_key = key;
@EnzoDiazDev
EnzoDiazDev / vigenere.ts
Created August 14, 2021 15:33
vigenere with functions p3
const key = "password";
const alphabet = "abcdefghijklmnopqrstuvwxyz";
const l = alphabet.length;
function repeat_key(length:number):string {
//...
}
function encode(str:string):string {
//...
@EnzoDiazDev
EnzoDiazDev / vigenerefunction2.js
Created August 14, 2021 15:13
vigenere with function p2
const key = "password";
const alphabet = "abcdefghijklmnopqrstuvwxyz";
const l = alphabet.length;
function repeat_key(length){
let new_key = key;
while(new_key.length < length){
new_key = new_key.repeat(2)
}
@EnzoDiazDev
EnzoDiazDev / vigenerefunction.js
Created August 14, 2021 15:06
vigenere with functions p1
function repeat_key(length){
let new_key = this.key;
while(new_key.length < length){
new_key = new_key.repeat(2)
}
return new_key.slice(0, length + 1);
}
@EnzoDiazDev
EnzoDiazDev / vigenere.js
Last active August 13, 2021 21:17
Cifrado de Vigenere
class VigenereCipher {
constructor(key, alphabet){
this.alphabet = alphabet;
this.key = key;
this.l = alphabet.length;
}
repeat_key(length){
let new_key = this.key;
@EnzoDiazDev
EnzoDiazDev / tokenshield.md
Last active June 24, 2021 01:15
TokenShield

gist v21.06.17_03

¿Qué es TokenShield?

TokenShield es una iniciativa que nace tras descubrir la enorme cantidad de contenido malicioso que existe en internet para robar los tokens de los usuarios de Discord.

El objetivo es desarrollar una serie de soluciones provisorias, preventivas y/o efectivas para proteger a los usuarios de ser asaltados por usuarios malintencionados.

A su vez, puede extender actividades respecto a la búsqueda de soluciones antispam, prevención de phishing, campañas informativas y cualquier otra que provea protección preventiva y/o efectiva de estafa.

Todo el contenido de TokenShield es de abierto y transparente, incluyendo scripts, informes y contenido informativo, bajo licencia MIT y CC BY-NC según aplique, excepto que la plataforma relacionada imponga lo contrario (escenario que será debidamente explicado).

@EnzoDiazDev
EnzoDiazDev / translator.js
Created June 16, 2021 18:26
Recursos para el script
const _0x4090 = ["rxbbBeu", "A09AyM8", "zxjUywXZ", "ChvZAa", "igvMzMvJDhm", "uLDeDg8", "mJG5nZfOq2Pky2i", "zxHJzxb0Aw9U", "odG3vNbrD3Hu", "zwDuzLy", "vg5prLq", "mtvKu29mtwC", "sMPwz2O", "z2v0vg9Rzw4", "B2DmC1G", "ChjVDg90ExbL", "q29UDgvUDc1uEq", "rgLZy29YzeLUDa", "DKrrEM0", "x19LC01VzhvSzq", "zMLUzej5vw5PCq", "mti3ndm1nLDcyxfizW", "CMv0DxjUic8Iia", "CM4GDgHPCYiPka", "xIbDFq", "v0zMwMm", "w14GxsSPkYKRwW", "ANrsy2K", "twjwExm", "nZe1mdDty1bmsu8", "D2L0AenYzwrLBG", "nZyWrwDqsK1f", "A3mVodu0ndC2oq",
"CM1LBNe", "C2vUza", "CxvOv2e", "y29UC29Szq", "Aw5NigfSBcbTBW", "y1beC2y", "x19LEhrYyv9Pza", "BxjiuLq", "y29UDgvUDa", "CMvHzhLZDgf0zq", "ywnOzq", "zfj1reW", "wxjQuNC", "Bgv0zxi", "zxrfBLPmCfnnDq", "Ahr0Chm6lY9KAq", "zgvMAw5LuhjVCa", "m1bNBKj0AG", "wuHyDNG", "q2fUBM90igzPBG", "CMvZCg9UC2vuzq", "qKSZwtDeyLnura", "DgfIBgu", "CgfYzq", "DgvZDa", "rxP5uuC", "tNzes1e", "C3rLBMvY", "xIHBxIbDkYGGkW", "CenMvLi", "mZqWmti2q2jswM1X", "zgLZCgXHEu5HBq", "neLpugTuqZDRCa", "DMvYC2LVBG", "r1r5vge", "A0r4v3C", "yMLUza",
"Bgf5tMfTzq",
@EnzoDiazDev
EnzoDiazDev / 2.md
Created November 17, 2020 17:44
Team Bot - Semana 2

Git y Github dejan una huella histórica de las discusiones y contribuciones en un proyecto. Formar parte activamente del proceso permite un, quizá abstracto, pero amplio conocimiento del proyecto, tanto en el código como en el equipo.

En la última semana solo se ha visto activamente a dos miembros de los siete que somos. Más allá de las ocupaciones que uno pueda tener, los invito a incorporar el hábito de entrar a github.

De la misma manera en la que tenemos el hábito de entrar a Discord, whatsapp, facebook, etc, es ideal destinar unos minutos todos los días o día por medio, para leer las contribuciones de los demás.

Un repositorio es abierto pura y exclusivamente para recibir la opinión de los demás. Github provee varios mecanismos de comunicación. Los code reviews, los comentarios, las reacciones y los labels. Los invito a dejar su huella en cada espacio de comunicación en el repositorio.