Dennis Yurichev - RSS Feed

by Dennis Yurichev

Latest articles

[Math][Python] Project Euler #99 and logarithmic representation

From their website: Comparing two numbers written in index form like \( 2^{11} \) and \( 3^7 \) is not difficult, as any calculator would confirm that \( 2^{11} = 2048 519432^{525806} \) would be much more difficult, as both numbers contain over three million digits. Using base_exp.txt (right click and 'Save Link/Target As...'), a 22K text...

[Math] Modulo inverse and the solution to the reverse engineering challenge #87

The following reverse engineering challenge was published by me in summer 2017, as the hardest among those challenges. What does it do? Here is it rewritten to pure C: uint32_t modinv32 (uint32_t x) { uint32_t rslt=1; for (int i=0; i<31; i++) { rslt = (rslt * x); x = (x * x); ...

[Math] Factlets about integer factorization

There is a toyish *NIX utility factor available, which can factorize small numbers. GCD is simply common factors. Here is 3*3: % factor 9999999999 9999999999: 3 3 11 41 271 9091 87654321 87654321: 3 3 1997 4877 Let's check: % python3 Python 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0] on linux Type "help", "copyright",...

[SAT] Deducing CNF for multi-input XOR function

From Wikipedia I knew a CNF formula for 2-input XOR: \( (\overline{A} \vee \overline{B} \vee C) \wedge (A \vee B \vee C) \wedge (A \vee \overline{B} \vee \overline{C}) \wedge (\overline{A} \vee B \vee \overline{C}) \) I wanted to generalize it to multi-input XOR. Let's first try to use Wolfram Mathematica's CNF generator. What it will say...

[Math] Exponentiation and binary logarithm for network administrators

Well-known Google free DNS IPv4 address: % whois 8.8.8.8 ... NetRange: 8.0.0.0 - 8.127.255.255 CIDR: 8.0.0.0/9 ... How many hosts in this network? (Python) >>> 2**(32-9) 8388608 Majority of networks has the prefix x.y.z.t/24 >>> 2**(32-24) 256 Yes, 256 hosts in...

[RevEng][Math] Data compression and entropy

This is yet another blog post about entropy. This time we will measure a weight of effective information in some data. Or payload (not in exploit sense). # generate RSA key openssl genrsa -out keypair.pem 4096 # extract public key out of it openssl rsa -in keypair.pem -pubout -out pubkey.pub # dump secret key: openssl rsa -noout -text...

Using tabs

Yes, any text editor can be tuned so that it will use spaces instead of tabs, always. But sometimes, tabs are useful: #!/usr/bin/env python3 # instead of: for i in range(10): print ("%5d %5d %5d" % (i, i**2, i**3)) print ("") # we write this: for i in range(10): print ("%d\t%d\t%d" % (i, i**2, i**3)) 0 0 ...

[Math][Python] Mixed radix, role-playing dices and PRNG

I'm not into RPG. But I always wondered, how to get some big number by throwing all these dices? When you have a coin, and you want to get a 16-bit number (16 bits of entropy), just throw it 16 times. When you have a D4 or D8 dice it's also easy -- the first can generate 2 bits at each throw, the second -- 3 bits. Having a D10 is good for generating...

[Russian] Как писать технические тексты

Disclaimer: всё это только о технических текстах. Художественная литераура, поэзия -- это совершенно другое, и с технической/научной литературой имеет мало чего общего. Наверное мне еще рановато раздавать такие советы. Это эквивалентно публичному признанию, что ты уже исписался, а может и не умел-то ничего. Ну да ладно, всё равно напишу. ...

[Crypto] Safe backups (or ransomware) using RSA/PGP/GnuPG/OpenSSL

As you may know, RSA itself isn't used for encryption/decryption, because it's too slow for that. (However, this is possible.) But rather RSA is used to generate a small key that is used with AES (or another symmetric cryptoalgo). Here is a typical scheme. Alice wants to encrypt a message to Bob. She generates a random session key....

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!