Dennis Yurichev - RSS Feed

by Dennis Yurichev

Latest articles

[Crypto] RSA: how Chinese Remainder Theorem is used here

You probably saw this: % openssl genrsa -out keypair.pem 512 % openssl rsa -noout -text -in keypair.pem RSA Private-Key: (512 bit, 2 primes) modulus: 00:fd:1a:2f:5a:b9:01:4f:85:f7:72:a4:c2:6f:58: 43:c8:6a:4c:dc:2b:3f:96:08:8e:e9:ed:4e:c2:92: e4:3c:02:c8:2e:09:63:23:ad:45:6b:92:fa:a7:88: 3a:0c:4b:08:cf:aa:fd:b5:64:cd:28:5e:3a:6a:53:...

[Crypto] Birthday attack: yet another explanation

For this example, I devised my own hash function. It's SHA2-224, but I use only 32 bits. Quick question, what this code will print? #!/usr/bin/env python3 import hashlib from collections import defaultdict def my_hash(s): m = hashlib.sha224() m.update(s.encode('utf-8')) return int.from_bytes(m.digest()[0:4], byteorder='big')...

[Crypto] Low-exponent attack on RSA: an example

This is a real piece of SageMath/Python code (Jupyter) I devised for the example. Jupyter exported HTML. Three 4096-bit RSA keys, but (public) exponent is too low - 3. If the same message was encrypted to these 3 keys, the message can be recovered. Let's see, how it works. Chinese Remainder Theorem states, that for a system of equation......

My Discord server/channels

My Discord server/channels

[Unix][Crypto] Simplest possible password manager

Once I was happy with Password Safe, but I wanted something even simpler. Here is my solution I use daily. You only have to memorize your master password. The following script can be publically available to anyone. Run it, enter master password and your generated password is pushed to clipboard(s). #!/usr/bin/env bash read -p "Enter...

[Python][Math] Deciphering Uber rating

As a very worrisome neurotic I always been wondering, can I get my internal Uber statistics based only on rating(s)? Hard to believe, but yes. But you should get as many ratings as possible, an interrupted 'chain' of ratings. Also, you need to predict a minimal and maximal number of ratings you've got. Taxi drivers don't always rate their...

[Lisp, ML, Haskell] Tail call/recursion/optimization

Many noob Lispers, including myself, have a hard time understanding, what is proper tail call/recursion/optimization, and what is not. Here is some code I've stole from Wikipedia. (Rewritten to pure C.) #include <stdio.h> int fact_iter(int n, int a) { if (n==0) return a; return fact_iter(n-1, n*a);...

ElGamal signature scheme

First part: ElGamal encryption system, cracking it using CADO-NFS All variable names as in Wikipedia's explanation of ElGamal signing scheme. As in ElGamal encryption scheme, we reuse these parameters and keys: g, p are public parameters. x, y are keys. x - private, y - public. Let m be a message. Generate 'ephemeral...

ElGamal encryption system, cracking it using CADO-NFS

ElGamal encryption system shares a lot with Diffie–Hellman key exchange, so please read my previous blog post about it first, Toy example All variable names are the same as in the Wikipedia article. Generate g/p parameters as for Diffie-Hellman scheme. (g is generator, p is a prime.) #!/usr/bin/env python3 import random, math...

[Math] Drawing a circle, point-by-point, without floating point support

Now we need to add a circle to our clock. Circle is defined by Pythagorean theorem: $x^2 + y^2 = r^2$, where $x$ and $y$ -- coordinates on plain and $r$ is radius. Naive algorithm So let's draw it! Enumerate all points in 0..radius range and find "height" for each point. Height will be $\sqrt{r^2 - y^2}$ We will draw only a quadrant,...

Discover, share and read the best on the web

Follow RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters! Get unfiltered news feeds or filter them to your liking.

Get Inoreader
Inoreader - Follow RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters!