blog.area23.at - a simple url encoder/decoder

 a simple url encoder/decoder
 https://blog.area23.at

Labels

Wirtschaft (156) Pressefreiheit (149) Österreich (125) IT (109) code (69) Staatsschulden (37) EZB (27) Pensionssystem (16) Geopolitik (11)
Posts mit dem Label code werden angezeigt. Alle Posts anzeigen
Posts mit dem Label code werden angezeigt. Alle Posts anzeigen

2025-10-20

Die Anzahl der Anordnungen der Elemente einer endlichen Menge

Prolog

When students in the 2nd semester in year 1992 type on the laptop during the lecture or start talking, Professor Gerd Baron always repeated very loudly that's what's all about:

Wir haben hier ein Universum und es geht um 
die Anzahl der Anordnungen der Elemente einer endlichen Menge.

We have a universe here and 
it's all about of the number of combinations of items in a finite set.

Professor Gerd Baron of Mathematics modified math lecture for computer scientists, where he claimed graph theory and combinatorics and weighted models (for traveling salesmen or ip routing graph) to understand better things we will need later (like equal costs => multipath).


In the years 2021-2023 [ CV ] I coded after an idea of Georg Toth the SUPU (SUdocu PUzzle) game. For the "Game Automation" mode I needed a smart permutation algorithm, where I remembered Professor Baron.


After meeting my old friend Math and Physics Professor Michael F. (worked also for finance in the City of London) and we talked about inversible matrixes, I was penetrated once in night with some gadgets and I spoke out that idea. But instead of giving the information only to unknown (maybe russian or far right spies), I wrote that article down, so that everybody also all partners in the US will recognize this.

Easiest way to scale up AES: combination & permutation

Encryption: plain text ⟶ 3DES PBox → AES → 2-fish ⟶ cipher bytes
Decryption: cipher bytes ⟶ 2-fish → AES → 3DES SBox ⟶ plain text

Encryption: (use base64 encode and decrypt function of block chiphers)
plain text ⟶ AES ⟶ 2-fish⟶ 3DES PBox (scrambled) ⟶ base64  cipher text

Decryption: (use base64 decode and decrypt function of block chiphers)
cipher text ⟶ base64  3DES  SBox(scrambled) → 2-fish→ AES ⟶ plain text

you also can remix it per good random numbers like
3DES = 0x1
AES = 0x2
2Fish = 0x4
Serpent = 0x8

So 0xBC for encryption would mean 0xCB for decryption
plain ⟶ (3DES→AES→Serpent) ⟶ (2Fish→Serpent) ⟶ encrypted
encrypted ⟶ (Serpent→2Fish) ⟶ (Serpent→AES→3DES) ⟶ plain 

with 2 bytes strong keys (negoatiated randomized at handshake) you're quiet secure.


Mathematical theorem in functional theory would be:
Consider that there are full bijective desterministic inversible functions, 
where inverse function to y=F(x,...) is 
x =f(y,..), => 
then inverse function to F( G( H( I( J( K( L( M( N(x, ...)))))))))
is x = n( m( l( k( j( i( h( g( f(y,...))))))))).

approach for a mathematical proof

You can see a mapping from ascii-8 → ascii-8 
also always as Matrix from R256 ➝ R256 
or hexadecimal from Rx100 ➝ Rx100
Functions also can be normal math operations of elements in 
e.g.

n ... number to symm crypt
k ... key to for encryptin
r ... result
n, k ∈ ℝ, n!=0,k!=0, n!=1, k!=1
E,e.F,f,G,h,H,h 

r0 = E(k) = k^n0  n0 = e(k) = ( ln(r0) / ln(k) )
r1 = F(k) = n1^k  n1 = f(k) = ( k√r1 )
r2 = G(k) = n2*k ⇔ n2 = g(k) = ( r2 / k )
r3 = H(k) = n3+k ⇔ n3 = h(k) = ( r3 - k) 

Multiple symmetric cipher encryption prototype

Try it out on area23: https://area23.at/net/Crypt/CoolCrypt.aspx
Github repository: github.com/heinrichelsigan/area23.at/


A simple matrix encryption algorithm by myself:

I found a simple matrix symmetric encryption algorithm, that works as simple symmetric cipher
with NxN Matrix trans, after asking that question here on  math.stackexchange.com/questions/4915786/ 
Later I developed a very simple Block Chipher Algorithm called ZenMatrix (to show, that I can write a very simple symmetric Block Cipher for encryption and decryption on my own),

R3 ➝ R3: v(3) x M(3,3) = v(3)

⎡ 1 ⎤    ⎡ 0 1 0 ⎤    ⎡ 2 ⎤ 
⎢ 2 ⎥ x  ⎢ 0 0 1 ⎥ =  ⎢ 3 ⎥  
⎣ 3 ⎦    ⎣ 1 0 0 ⎦    ⎣ 1 ⎦ 
The inverse matrix for reverse symmetric encryption would be:
⎡ 2 ⎤    ⎡ 0 0 1 ⎤    ⎡ 1 ⎤ 
⎢ 3 ⎥ x  ⎢ 1 0 0 ⎥ =  ⎢ 2 ⎥  
⎣ 1 ⎦    ⎣ 0 1 0 ⎦    ⎣ 3 ⎦ 
ZenMatrix symetric chiffre encryption

More symmetric cipher algos are now availible!

First I wanted to make the symmetric cipher pipe only with AES, Blowfish, 2-Fish, 3-DES and  ZenMatrix, but then I detected the Legion of Bouncy-Castle, which offered several encryptions in a opensource library also availible here at git: https://github.com/bcgit
I rewrote Area23.At.Mono with the Bouncy-Castle wrapper of for 3DES, 2FISH, 3FISH, AES, Rijndael (same as AES) and Serpent.

Later I added the following symmetric cipher encryption / decryption algorirhms to the symm cipher pipeline, because I have seen them in the bouncy-castle package:
Camellia, Cast[56], Gost28147, Idea, RC[26], RC532, Seed, Skipjack, Tea, Tnepres, XTea.

PermAgainCrypt [WinForm Demo]

I wrote a simple WinForm with a reduced framework code, to understand the basic symm cipher pipe encryption, here on git: https://github.com/heinrichelsigan/PermAgainCrypt

https://github.com/heinrichelsigan/PermAgainCrypt

How many variations are possible?

With a set of 2 symmetric cipher algos without reusing the same algo twice, it would be 2! = 2, with reusing same algo twice (e.g. blowfish => blowfish =>) 2^2 = 4. With 8 symmetric cipher algos without reusing the same algo, it would be 8! = 40.320, with reusing the same algo twice 8^8 = 16.777.216.
In the symmetric cipher pipe above with now 21 symmetric cipher algortihms it would be 21^8 = 37.822.859.361, because I limited the pipeline length to 8 stages.

Why I'm publishing this article?

Unfortunately, since I catched a schizoaffective disorder 2007, I have sometimes the tendency to talk loudly and am often paranoid about being wiretapped.
Existing even bigger companies, were I was employed, (I told them about my problem since 2007) meaned, that I didn't break the compliance in that case, because I can assume that we have not the GDR with Stasi here and loudly repeating fraud detection rules at home isn't a crime. Once I feeled very painful and a spoke out loudly my idea of better AES. To avoid, that only some people could get it, I wrote a simple prototype and then sended this article to old friends, who work at US companies.

2025-10-02

x86_64 and aarch64 arm cpu bugs

bhi
cpu_meltdown
eibrs_pbrsb
itlb_multihit
its
l1tf
gather_data_sampling
ghostwrite
indirect_target_selection
itlb_multihit
mds
mmio_stale_data
reg_file_data_sampling
retbleed
rfds
spec_rstack_overflow
spec_store_bypass
spectre_v1
spectre_v2
spec_store_bypass
srbds
swapgs
tsx_async_abort
lscpu [ https://man7.org/linux/man-pages/man1/lscpu.1.html ]shows a little other information as
lscpu

cat /proc/cpuinfo

smaller arm aarch664 cpus are affected so far by fewer bugs as large Inter x86_64


2025-09-12

Exception handling in C#, Java, C++

C#

In C# Exception is root of all exceptions extends base class System.Exception : ISerializable¹ and differs basically between System.SystemException and System.ApplicationException.
Of course, that are a lot of Exception derived directly from System.Exception.


ExternalException, Win32Exception, WebException, IOException, SocketException and all exceptions thrown during os system operations extend SystemException or it's children.

Java

In Java Throwable (root of all errors & exceptions) extends base class object. Error and Exception both extend from Throwable.

Errors such StackOverflowError (endless recursion), OutOfMemoryError (endless allocation) and VirtualMachineError are thrown, when critical limits of java virtual machine exceeded.

In java some exceptions like IOException or SocketException are "checked at compile time". This does NOT mean, that javac compiler knows when IOException or SocketExcpetion will be thrown at program flow at runtime. Furthermore javac compiler knows if reading from or writing to a file needs catching an IOExceptiuon, because disk might be full or USB stick could be unplugged or fs mount point is now unmounted or remounter ro. When reading from or writing to a socket javac compiler knows, that you must catch a SocketException in case of a linux system init runlevel 1 or 2, unplugging USB network adapter or dog bites CAT5 or CAT7 network cable.

C++

In C++ there is no binary split at the root of "exception tree" as in C# (System Exception &
ApplicationException) or in Java (Error & Exception both extend from Throwable).

In C++ bad_cast, bad_alloc, bad_function_call, logic_error & runtime_error extend from exception.
Most common Exceptions in C++ extend from logic_error & runtime_error.b.


2025-08-09

Is there a way under windows to mount a in exe included disk image at runtime

[ Original question postetd at stackoverflow 
maybe you have an idea how that will work under Windows >= 7 or in any case >= 10

I want to generate an executable, where an disk image is added (linked at compile time) to the exe.

Under linux, it's possible to mount an image with a certain offset

  • mount

    mount -o loop,offset=$((1024 * 512 * 8)) image.raw /mnt

  • losetup

    losetup /dev/loop0 image.raw -o $((1024 * 512 * 8)) mount /dev/loop0 /mnt

  • I wrote a simple shell script, that demonstrates that with the efi boot partition added afterwards to a zero image with 8*512k blocks.

#!/usr/bin/bash
 
BLOCKSIZE=`echo '512  * 1024' | bc`
SEEK=8
OFFSET=$(echo "$BLOCKSIZE * $SEEK" | bc)
 
dd if=/dev/zero of=zero.img bs=512k count=8
cp zero.img offset_disk.img
dd if=/dev/nvme0n1p15 of=offset_disk.img bs=$BLOCKSIZE seek=$SEEK oflag=append
 
mkdir -p /mnt/efi
mount -o loop,offset=$OFFSET offset_disk.img /mnt/efi
du -h -s *.img ; df -h  | grep efi
 
sleep 1 ; umount /mnt/efi ; rm -f zero.img offset_disk.img
exit 0

Output of shell script -x (debug


The creation of the image file added to an executable would not be the problem, because I understand:

How to link a dll or dll embedded resource or image file to an executable with C++ linker

and also C# .Net crossgen2 to produce a big static exe, that needs no Framework anymore

The only problem I have, is how to mount disk / iso9660 image files with a certain offset.