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 IT werden angezeigt. Alle Posts anzeigen
Posts mit dem Label IT 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-13

EU Charter of Fundamental Rights

Article 1 - Human dignity

The dignity of the human person is not only a fundamental right in itself but constitutes the real basis of fundamental rights. The 1948 Universal Declaration of Human Rights enshrined human dignity in its preamble: ‘Whereas recognition of the inherent dignity and of the equal and inalienable rights of all members of the human family is the foundation of freedom, justice and peace in the world.’ In its judgment of 9 October 2001 in Case C-377/98 Netherlands v European Parliament and Council [2001] ECR I-7079, at grounds 70 — 77, the Court of Justice confirmed that a fundamental right to human dignity is part of Union law.
It results that none of the rights laid down in this Charter may be used to harm the dignity of another person, and that the dignity of the human person is part of the substance of the rights laid down in this Charter. It must therefore be respected, even where a right is restricted.

Article 2 - Right to life

1. Everyone has the right to life
2. No one shall be condemned to the death penalty, or executed.

Article 3 - Right to integrity of the person

1. Everyone has the right to respect for his or her physical and mental integrity.
2. In the fields of medicine and biology, the following must be respected in particular:
(a) the free and informed consent of the person concerned, according to the procedures laid down by law;
(b) the prohibition of eugenic practices, in particular those aiming at the selection of persons;
(c) the prohibition on making the human body and its parts as such a source of financial gain;
(d) the prohibition of the reproductive cloning of human beings.
 

Article 4 - Prohibition of torture and inhuman or degrading treatment or punishment

No one shall be subjected to torture or to inhuman or degrading treatment or punishment.

Article 5 - Slavery / Forced Labour

1. No one shall be held in slavery or servitude.
2. No one shall be required to perform forced or compulsory labour.
3. Trafficking in human beings is prohibited.

Article 6 - Right to liberty and security

Everyone has the right to liberty and security of person.

Article 7 - Respect for private and family life

Everyone has the right to respect for his or her private and family life, home and communications.

Article 8 - Protection of personal data

1. Everyone has the right to the protection of personal data concerning him or her.
2. Such data must be processed fairly for specified purposes and on the basis of the consent of the person concerned or some other legitimate basis laid down by law. Everyone has the right of access to data which has been collected concerning him or her, and the right to have it rectified.
3. Compliance with these rules shall be subject to control by an independent authority.

Article 9 - Right to marry and right to found a family

The right to marry and the right to found a family shall be guaranteed in accordance with the national laws governing the exercise of these rights.

Article 10 - Freedom of thought, conscience and religion

1. Everyone has the right to freedom of thought, conscience and religion. This right includes freedom to change religion or belief and freedom, either alone or in community with others and in public or in private, to manifest religion or belief, in worship, teaching, practice and observance.
2. The right to conscientious objection is recognised, in accordance with the national laws governing the exercise of this right.

Article 11 - Freedom of expression and information

1. Everyone has the right to freedom of expression. This right shall include freedom to hold opinions and to receive and impart information and ideas without interference by public authority and regardless of frontiers.
2. The freedom and pluralism of the media shall be respected.

Article 12 - Freedom of assembly and of association

1. Everyone has the right to freedom of peaceful assembly and to freedom of association at all levels, in particular in political, trade union and civic matters, which implies the right of everyone to form and to join trade unions for the protection of his or her interests.
2. Political parties at Union level contribute to expressing the political will of the citizens of the Union.

Article 13 - Freedom of the arts and sciences

The arts and scientific research shall be free of constraint. Academic freedom shall be respected.

Article 14 - Right to education

1. Everyone has the right to education and to have access to vocational and continuing training.
2. This right includes the possibility to receive free compulsory education.
3. The freedom to found educational establishments with due respect for democratic principles and the right of parents to ensure the education and teaching of their children in conformity with their religious, philosophical and pedagogical convictions shall be respected, in accordance with the national laws governing the exercise of such freedom and right.

Article 15 - Freedom to choose a job and right to engage in work

1. Everyone has the right to engage in work and to pursue a freely chosen or accepted occupation.
2. Every citizen of the Union has the freedom to seek employment, to work, to exercise the right of establishment and to provide services inany Member State
3. Nationals of third countries who are authorised to work in the territories of the Member States are entitled to working conditions equivalent to those of citizens of the Union.

Article 16 - Freedom to conduct a business

The freedom to conduct a business in accordance with Union law and national laws and practices is recognised.

Article 17 - Right to property

1. Everyone has the right to own, use, dispose of and bequeath his or her lawfully acquired possessions. No one may be deprived of his or her possessions, except in the public interest and in the cases and under the conditions provided for by law, subject to fair compensation being paid in good time for their loss. The use of property may be regulated by law in so far as is necessary for the general interest.
2. Intellectual property shall be protected.

Article 18 - Right to asylum

The right to asylum shall be guaranteed with due respect for the rules of the Geneva Convention of 28 July 1951 and the Protocol of 31 January 1967 relating to the status of refugees and in accordance with the Treaty on European Union and the Treaty on the Functioning of the European Union (hereinafter referred to as 'the Treaties').

Article 19 - Protection in the event of removal, expulsion or extradition

1. Collective expulsions are prohibited.
2. No one may be removed, expelled or extradited to a State where there is a serious risk that he or she would be subjected to the death penalty, torture or other inhuman or degrading treatment or punishment.

Article 20 - Equality before the law

Everyone is equal before the law.

Article 21 - Non-discrimination

1. Any discrimination based on any ground such as sex, race, colour, ethnic or social origin, genetic features, language, religion or belief, political or any other opinion, membership of a national minority, property, birth, disability, age or sexual orientation shall be prohibited.
2. Within the scope of application of the Treaties and without prejudice to any of their specific provisions, any discrimination on grounds of nationality shall be prohibited.

Article 22 - Cultural, religious and linguistic diversity

The Union shall respect cultural, religious and linguistic diversity.

Article 23 - Equality between women and men

Equality between women and men must be ensured in all areas, including employment, work and pay. The principle of equality shall not prevent the maintenance or adoption of measures providing for specific advantages in favour of the under-represented sex.

Article 24 - The rights of the child

1. Children shall have the right to such protection and care as is necessary for their well-being. They may express their views freely. Such views shall be taken into consideration on matters which concern them in accordance with their age and maturity.
2. In all actions relating to children, whether taken by public authorities or private institutions, the child's best interests must be a primary consideration.
3. Every child shall have the right to maintain on a regular basis a personal relationship and direct contact with both his or her parents, unless that is contrary to his or her interests.

Article 25 - The rights of the elderly

The Union recognises and respects the rights of the elderly to lead a life of dignity and independence and to participate in social and cultural life.

Article 26 - Integration of persons with disabilities

The Union recognises and respects the right of persons with disabilities to benefit from measures designed to ensure their independence, social and occupational integration and participation in the life of the community.

Article 27 - Workers' right to information and consultation within the undertaking

Workers or their representatives must, at the appropriate levels, be guaranteed information and consultation in good time in the cases and under the conditions provided for by Union law and national laws and practices. Everyone is equal before the law.

Article 28 - Right of collective bargaining and action

Workers and employers, or their respective organisations, have, in accordance with Union law and national laws and practices, the right to negotiate and conclude collective agreements at the appropriate levels and, in cases of conflicts of interest, to take collective action to defend their interests, including strike action.

Article 29 - Right of access to placement services

Everyone has the right of access to a free placement service.

Article 30 - Protection in the event of unjustified dismissal

Every worker has the right to protection against unjustified dismissal, in accordance with Union law and national laws and practices.

Article 31 - Fair and just working conditions

1. Every worker has the right to working conditions which respect his or her health, safety and dignity.
2. Every worker has the right to limitation of maximum working hours, to daily and weekly rest periods and to an annual period of paid leave.

Article 32 - Prohibition of child labour and protection of young people at work

The employment of children is prohibited. The minimum age of admission to employment may not be lower than the minimum school-leaving age, without prejudice to such rules as may be more favourable to young people and except for limited derogations. Young people admitted to work must have working conditions appropriate to their age and be protected against economic exploitation and any work likely to harm their safety, health or physical, mental, moral or social development or to interfere with their education.

Article 33 - Family and professional life

1. The family shall enjoy legal, economic and social protection.
2. To reconcile family and professional life, everyone shall have the right to protection from dismissal for a reason connected with maternity and the right to paid maternity leave and to parental leave following the birth or adoption of a child.

Article 34 - Social security and social assistance

1. The Union recognises and respects the entitlement to social security benefits and social services providing protection in cases such as maternity, illness, industrial accidents, dependency or old age, and in the case of loss of employment, in accordance with the rules laid down by Union law and national laws and practices.
2. Everyone residing and moving legally within the European Union is entitled to social security benefits and social advantages in accordance with Union law and national laws and practices.
3. In order to combat social exclusion and poverty, the Union recognises and respects the right to social and housing assistance so as to ensure a decent existence for all those who lack sufficient resources, in accordance with the rules laid down by Union law and national laws and practices.

Article 35 - Health care

Everyone has the right of access to preventive health care and the right to benefit from medical treatment under the conditions established by national laws and practices. A high level of human health protection shall be ensured in the definition and implementation of all Union policies and activities.

Article 36 - Access to services of general economic interest

The Union recognises and respects access to services of general economic interest as provided for in national laws and practices, in accordance with the Treaties, in order to promote the social and territorial cohesion of the Union.

Article 37 - Environmental protection

A high level of environmental protection and the improvement of the quality of the environment must be integrated into the policies of the Union and ensured in accordance with the principle of sustainable development.

Article 38 - Consumer protection

Union policies shall ensure a high level of consumer protection.

Article 39 - Right to vote and to stand as a candidate at elections to the European Parliament

1. Every citizen of the Union has the right to vote and to stand as a candidate at elections to the European Parliament in the Member State in which he or she resides, under the same conditions as nationals of that State.
2. Members of the European Parliament shall be elected by direct universal suffrage in a free and secret ballot.

Article 40 - Right to vote and to stand as a candidate at municipal elections

Every citizen of the Union has the right to vote and to stand as a candidate at municipal elections in the Member State in which he or she resides under the same conditions as nationals of that State.

Article 41 - Right to good administration

1. Every person has the right to have his or her affairs handled impartially, fairly and within a reasonable time by the institutions, bodies, offices and agencies of the Union.
2. This right includes:
(a) the right of every person to be heard, before any individual measure which would affect him or her adversely is taken;
(b) the right of every person to have access to his or her file, while respecting the legitimate interests of confidentiality and of professional and business secrecy;
(c) the obligation of the administration to give reasons for its decisions.
3. Every person has the right to have the Union make good any damage caused by its institutions or by its servants in the performance of their duties, in accordance with the general principles common to the laws of the Member States.4. Every person may write to the institutions of the Union in one of the languages of the Treaties and must have an answer in the same language.

Article 42 - Right of access to documents

Any citizen of the Union, and any natural or legal person residing or having its registered office in a Member State, has a right of access to documents of the institutions, bodies, offices and agencies of the Union, whatever their medium.

Article 43 - European Ombudsman

Any citizen of the Union and any natural or legal person residing or having its registered office in a Member State has the right to refer to the European Ombudsman cases of maladministration in the activities of the institutions, bodies, offices or agencies of the Union, with the exception of the Court of Justice of the European Union acting in its judicial role.

Article 44 - Right to petition

Any citizen of the Union and any natural or legal person residing or having its registered office in a Member State has the right to petition the European Parliament.

Article 45 - Freedom of movement and of residence

1. Every citizen of the Union has the right to move and reside freely within the territory of the Member States.
2. Freedom of movement and residence may be granted, in accordance with the Treaties, to nationals of third countries legally resident in the territory of a Member State.

Article 46 - Diplomatic and consular protection

Every citizen of the Union shall, in the territory of a third country in which the Member State of which he or she is a national is not represented, be entitled to protection by the diplomatic or consular authorities of any Member State, on the same conditions as the nationals of that Member State.

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.