Soporte para archivos en Shield Cipher

 Muy bien, me ha costado un poco pero por fin hace dos semanas he implementado la encriptación de archivos con ShieldCipher :3


He tenido algunos problemas para hacerlo, ya que la primer versión llegaba a inflar hasta 3 veces lo archivos, haciendo que un archivo de 800 MB llegue a pesar 3 GB.

Pero porqué pasaba esto?

Pues porque esta muy mal optimizada la encriptación, el proceso era el siguiente:

El programa leía el binario del archivo, lo convertía a ASCII porque la función de encriptación funcionaba solo con texto, no con bytes y el problema era que en esa función estaba implementado el convertirlo a bytes, entonces simplemente le añadí un nuevo parámetro llamado is_byte y en caso de que sea true no lo convierte.

Mi librería de ciberseguridad

 Hace dos semanas publiqué la primera versión de Shield Cipher y ya lo puedes instalar con pip :3


Usé pycryptodome para encriptar de manera simétrica con AES el texto que le pases como argumento, ya está documentada y es muy sencilla de usar, tanto el cliente como la api.

No fue muy difícil programar la biblioteca ya que muchas de las funciones que tiene son reutilizadas de passmgr.py y ahora este proyecto ha migrado para usar mi nueva biblioteca.

Hamilton y La Obra Escocesa

 Hamilton es uno de mis musicales favoritos, de verdad amo todos los trabajos de Lin-Manuel Miranda.

Hace tiempo estaba viendo Hamilton y me di cuenta de algo curioso, en la tercera canción del segundo acto Take a break

En la carta que al principio de la canción Hamilton le escribe a Angelica (donde por cierto se hace énfasis en el My dearest, Angelica) dice lo siguiente:

My dearest, Angelica,

“tomorrow and tomorrow and tomorrow

creeps in this petty pace from day to day”

I trust you’ll understand the reference to

another Scottish tragedy without my having to name the play.

En esta parte podemos ver que Hamilton si hace una referencia a La Tragedia Escocesa haciendo énfasis en que no va a decir su nombre (ya que se considera de mala suerte decir Macbeth en un teatro si no se está interpretando esa obra), pero tenemos un plot twist ya que en el siguiente verso tenemos:

They think me Macbeth, and ambition is my folly,

I’m a polymath, a pain in the ass, a massive pain,

Madison is Banquo, Jefferson’s Macduff

And Birnam Wood is Congress on its way to Dunsinane.

Y esto podría quedar como una simple referencia o incluso un acto "revolucionario" ya que esa superstición es inglesa y se podría ver como una especie de "independencia teatral".

Pero no podemos negar que a partir de esta canción el leitmotif My Shot ya no le va a funcionar tanto a Hamilton como en el primer acto ya que justo en la siguiente canción tenemos Say no to this y en el resto del acto Schuyler Defeated, One Last Time, The Adams Administration, We Know, Hurricane, The Reynolds Pamphlet, Burn, It’s Quiet Uptown, Your Obedient Servant y The World Was Wide Enough

Portainer Installation

 The Portainer installation is a siple process, but maybe you'll find with some obstacles while doing it (specially with the Docker installation because the packages aren't in the default repositories).

The firt thing you have to do is to install Docker and the best way to do it is reading the docs, it's common to find tutorials that can tell you to install it with 'sudo apt install docker.io docker-compose' but this method have a probrem, this aren't the officialpackages and may be a security risk to install them.

Finally you only have to install Portainer, again reading the docs, and you'll be able to view the panel in the port 9433 using https.

Instalando Portainer

 La instalación de Portainer es muy sencilla, aunque puede haber algunas complicaciones (en especial con la instalación de Docker ya que se requieren algunos pasos extra para poder descargar los paquetes oficiales).

Lo primero que hay que hacer es instalar Docker y la mejor forma de hacerlo es siguiendo las instrucciones de la documentación, en muchos medios te puedes encontrar con que se puede instalar simplemente (en Ubuntu y otras distros basadas en Debian) con 'sudo apt install docker.io docker-compose) pero este método no es del todo seguro ya que no son los paquetes oficiales y pueden no estar con los últimos parches de seguridad y actualizaciones.

Finalmente solo debes instalar Portainer siguiendo igualmente las instrucciones de su documentación y ya podrás entrar desde el puerto 9443 con https.

Cloudflare Installation

 Well, now the million-dollar question, how can I make my website accessible to everyone? My ISP doesn't provide a public IPv4, so I thought about using a DDNS service like No-IP or the one included in Google Domains . However, I encountered another problem; my ISP uses double NAT, meaning my IPv4 could only be accessible to other users on my ISP. I realized I had a public IPv6 (although I believe it's also dynamic), so I added all my domains in AAAA records pointing to my IPv6 in the DNS. It worked for a moment, this way I didn't have to open ports on my router because that IP was unique to my PC. But there was a serious issue; my site was inaccessible to any network that didn't have IPv6 enabled (for example, my school's network).

My sites remained like this until one day I discovered a video by Network Chuck talking about Cloudflare Tunnels. I followed the instructions in his video, with a few small changes :3

I wanted to create the tunnel from the terminal and not in the panel, so I followed the instructions in the docs Create a locally-managed tunnel (CLI) · Cloudflare Zero Trust docsfor creating a locally-managed tunnel (CLI).

Afterwards, I found it very complicated to write the entire command to start my tunnel, so I created this script to execute it with 'mytunnel' (remember to make it executable).

It was also challenging to write the entire command to add my subdomain to the DNS, so I made this script.

Finally, I didn't want to have a terminal where the tunnel was always running, especially because I had to disconnect the SSH. So, I turned it into a service to start at system boot (remember to enable your service).

Instalando Cloudflare

 Bueno, ahora la pregunta del millón, como puedo hacer que mi pagina sea accesible para todo el mundo, mi ISP no me ofrece una ipv4 pública, así que pensé en utilizar un servicio de DDNS como No-IP o el que viene incluido en Google Domains pero tuve otro problema, mi ISP usa una doble NAT, eso quiere decir que mi ipv4 solamente podría ser accesible por los demás usuarios de mi ISP. Me di cuenta de que si tenia una ipv6 pública (aunque creo que también es dinámica) así que en mi DNS puse todos mis dominios en registros AAAA apuntando a mi IP y me funcionó por un momento, de esta manera ya no tenia que abrir puertos en mi Router porque esa IP era única para mi PC pero había un problema muy grave, mi sitio era inaccesible para cualquier red que no tuviera habilitado ipv6 (por ejemplo la red de mi escuela). Y mis sitios siguieron así hasta que un día descubrí un video de Network Chuck que hablaba sobre Cloudflare Tunnels, así que seguí las instrucciones de su video, pero hice unos pequeños cambios :3

Quise crear el túnel desde la terminal y no en el panel, entonces seguí las instrucciones que vienen la documentación Create a locally-managed tunnel (CLI) · Cloudflare Zero Trust docs.

Después, se me hizo muy complicado tener que escribir todo el comando completo para iniciar mi túnel, así que hice este script para ejecutarlo con 'mytunnel' (recuerda hacerlo ejecutable)

También se me hizo muy complicado el escribir todo ese comando para agregar mi subdominio a la DNS, así que hice este script

Y por último, no quería tener una terminal donde siempre se estuviera ejecutando el túnel, en especial porque tengo que desconectar el SSH, así que lo hice un servicio para que inicie al Bootear el sistema (recuerda habilitar tu servicio)

Instalando aaPanel

 Bueno, no escribí nada los últimos días, así que hoy voy a publicar dos entradas.


Hoy os voy a explicar cómo instalar aaPanel, es muy fácil. Solo hay que ejecutar el comando que aparece en Descargar (aapanel.com), elegir el que se adapte a tu sistema operativo, en mi caso, voy a elegir la instalación de Debian.

Después de ejecutar el comando, la consola te mostrará la URL y la Ruta Segura para acceder al Panel, también con el usuario y la contraseña, puedes cambiarlos en la interfaz del Panel o en la línea de comandos con el comando 'sudo bt'. Yo cambié la contraseña por una aleatoria usando passmgr.py | Gestor de contraseñas (rahcode.com).

Luego puedes acceder al panel y tienes que elegir entre dos pilas, LAMP (Linux, Apache, MySQL y PHP) o LEMP (Linux, Nginx [Engine X], MySQL y PHP), la recomendada es la que tiene Nginx, así que la voy a instalar. No te preocupes, puedes desplegar sitios web con otros lenguajes y bases de datos, solo tienes que instalarlos en la tienda de aplicaciones del panel.

Lo último que tienes que hacer es crear un sitio web, yo creé www.rahcode.com, e hice que rahcode.com redirigiera a él. Tenía dos opciones, clonar mi repositorio con mi sitio web o hacer un proxy inverso para compartirlo, decidí hacer un proxy inverso a milosnowcat.github.io.


aaPanel Installation

 Well, I didn't wrote anything the last days, so today I'll publish two entries.


Today I'll explain how to install aaPanel, it's very easy. You only need to run the command in Download (aapanel.com), choose the one that suits to your OS, in my case, I'll choose the Debian installation.

After executing the command the console will prompt you with the URL and Secure Path to access the Panel, also with the user an password, you can change it in the Panel UI or in the cli with the command 'sudo bt'. I changed the password to a random one using passmgr.py | Password Manager (rahcode.com).

Then you can access the panel and you cave to choose between two stacks, LAMP (Linux, Apache, MySQL and PHP) or LEMP (Linux, Nginx [Engine X], MySQL and PHP), the recommended one in the one with Nginx, so I'll install it. Don't worry you can deploy websites with other languages and databases, you only have to install it in the app store of the panel.

The last thing you have to do is to create a website, I created www.rahcode.com, and made rahcode.com to redirect to it. I had to options, clone my repository with my website or made a reverse proxy to share it, I decided to make a reverse proxy to milosnowcat.github.io.

Debian Installation

 Would you like to have your own home server to host your projects, files, or applications? In this post, I will explain how I did it with my laptop and an external hard drive.

The first thing you need is a computer; I chose to use my laptop because it was what I had on hand, but you can use any other available computer. The important thing is that it has enough storage capacity and memory for what you want to do with your server.

The second thing you need is an operating system; you can use a server-oriented one like Ubuntu Server or CentOS, but I opted for Debian because I like its stability and simplicity.

To install it, you need to boot a USB, you can use a program for that, like Rufus, but I prefer Ventoy because it allows you to have more than one operating system on your flash drive, and you only need to copy the ISO image into a folder.

Connect your USB to the computer and access the boot menu (it's different on each system, usually one of the F keys, Delete, or, in the case of Lenovo laptops, there is a button on the side that you can press with a pin) and select your USB and the operating system.

The installation is straightforward, and most configurations depend on your particular case. In mine, I chose to install a desktop environment to be able to use a browser within the server. Instead of GNOME, I chose XFCE because it is lighter and faster.

Instalando Debian

¿Te gustaría tener tu propio servidor casero para alojar tus proyectos, archivos o aplicaciones? En este post te voy a explicar cómo lo hice yo con mi portátil y un disco duro externo.

Lo primero que necesitas es un ordenador, yo elegí usar mi portátil porque es lo que tenía a mano, pero puedes usar cualquier otro que tengas disponible. Lo importante es que tenga suficiente capacidad de almacenamiento y memoria para lo que quieras hacer con tu servidor.

Lo segundo que necesitas es un sistema operativo, puedes usar uno orientado a servidores, como Ubuntu Server o CentOS, pero yo me decanté por Debian, porque me gusta su estabilidad y simplicidad.

Para instalarlo necesitas arrancar un USB, puedes usar un programa para eso, como Rufus, pero yo prefiero Ventoy, porque te permite tener más de un sistema operativo en tu pendrive y solo tienes que copiar la imagen iso en una carpeta.

Conecta tu USB al ordenador y accede al menú de arranque (es diferente en cada equipo, normalmente es una de las teclas F, Supr o, en el caso de los portátiles Lenovo hay un botón en el lateral que puedes pulsar con un alfiler) y selecciona tu USB y el sistema operativo.

La instalación es muy sencilla y la mayoría de las configuraciones dependen de tu caso particular, en el mío, elegí instalar un entorno de escritorio, para poder usar un navegador dentro del servidor, pero en vez de GNOME, escogí XFCE, porque es más ligero y rápido.

Soporte para archivos en Shield Cipher

 Muy bien, me ha costado un poco pero por fin hace dos semanas he implementado la encriptación de archivos con ShieldCipher :3 He tenido alg...