HNHacker News
TopNewBestAskShowJobs

JanisErdmanis

352 karma · joined January 18, 2021

submissionscomments
JanisErdmanis··on Botan: Crypto and TLS for Modern C++
Every developer is responsible for verifying the trustworthiness of given components when bringing the dependencies in and their upgrades. If the libraries are with a small API surface that is much easier to do than verifying for a big monoliths. One can simply check the specs for inputs and outputs to remain unchanged and that already provides assurances for incorrect implementations.

Regarding supply chain attacks one of the important points is to establish consensus on dependency versions and their hashes via distributed replication or transparency logs (like in go). The big monolith then does not offer any advantages in this aspect.

JanisErdmanis··on Botan: Crypto and TLS for Modern C++
Small libraries are easier to get into and contribute. Also, let’s say one develops some zero knowledge crypto system with Botan and then latter finds out that their elliptic curve implementation is not that performant. Improving performance of elliptic curves is one of the dark arts that only few know to do hence he decides to wrap one that OpenSSL library provides.

The essential question is whether he would be able to use OpenSSL implementation without changing internals of Botan or his own zero knowledge crypto system implementation. In modular libraries this is less of an issue as itself generally implies working with abstract groups and writing wrappers or implementations outside.

JanisErdmanis··on Botan: Crypto and TLS for Modern C++
I personally don’t like that every single cryptography scheme is included in a single library. This creates a fake sense of powerfulness, but breaks down once some more complicated things need to be done such as zero knowledge proofs or homomorphic computations when it can become awkward at best. In a sensible language one makes seperate modules for hashing, cryptographic group library, pseudorandom number generation, cryptographic signatures, various zero knowledge proofs and TLS and uses package manager to install what one needs.
JanisErdmanis··on Willow, Our Quantum Chip
Well, this is embarrassing. I just realised I had wrongly interpreted the result in [1]. I made an error on how Shor's algorithm encodes the numbers, wrongly assuming that numbers are encoded into quantum state space, which is 2^(2^n), where instead, there is one bit encoded into one qubit, which is also more practical.

The result shall be interpreted directly with the error rate for logical qubits to decrease as ~n^(-1/3). This, in turn, means that factorisation of a 10000-bit number would only require an error rate of 1/10th of the number of the logical qubits for a 10-bit number. This is practical given that one can make a quantum computer with around 100k qubits and correct errors on them.

On the other hand, a sibling comment already mentioned the limited connectivity that those quantum computers now have. This, in turn, requires a repeated application of SWAP gates to get the interaction one needs. I guess this would add a linear overhead for the noise; hence, the scaling of the error rate for logic qubits is around ~n^(-4/3). This, in turn, makes 10000-bit factorisation require a logical error rate of 1/10000 that of 10-bit number factorisation. Assuming that 10 physical qubits are used to reduce error by order, it can result in around 400k physical qubits.

[1]: https://link.springer.com/article/10.1007/s11432-023-3961-3

JanisErdmanis··on Problems with Python dependency management
I recently learned that uv is written in more than 100k lines of Rust code. Cudos to the developers! This is however also indicative of python dependency managment complexity.
JanisErdmanis··on Willow, Our Quantum Chip
An intersting read. So the general idea as I understand is that one can make signatures that pass or does not pass validation depending on the implementation while all implementations do protect against forgery.

In my opinion the correct approach here is the most liberal one for the Q, R points. One checks each point cofactor at parsing 8P=0 and then use unbatched equation for verification. This way implementations can be made group agnostic.

Having group agnostic implementations is important as it creates a proper separation of concerns between curve implementations and the code that uses them. For instance if we were to accept strict validation as the ground truth and best practice one would have enormously hard time specifying verifiers for zero knowledge proofs and would also double time and code for the implementers without any effect on soundness.

JanisErdmanis··on Willow, Our Quantum Chip
Beautiful analogy.
JanisErdmanis··on Willow, Our Quantum Chip
What they claim is that adding physical qubits reduce error rate of the logical qubits exponentially. For the Schor algorithm the error rate of the logical qubits must decrease exponentially with every single logical qubit added to make the system produce meaningful results.

To see how it plays out consider adding a single logical qubit. First you need to increase the number of physical qubits to accommodate the new logical qubit at the same error rate. Then multiply the number of physical qubits to accommodate for exponentially decreased error rate which would be a constant factor N ( or polynomial but let’s keep things simple) by which the number of physical qubits need to be multiplied to produce a system with one additional logical qubit with an error rate to produce meaningful results.

To attain 1024 logical qubits for Schor algorithm one would need N^1024 physical qubits. The case where N<1 would be possible if error would decrease by itself without additional error correction.

JanisErdmanis··on Willow, Our Quantum Chip
I think the idea here is that the choice on which hypothesis to verify is based on the risk assessment of the scientist whose goal is to optimize successful results and hence better theories are more likely to surface. In this way one does not need to form a consensus around the theory but instead make consensus on what constitutes a successful result.

Ideally this would be true, but funding agencies are already preloaded with implicit asssumptions what constitutes a scientific progress.

JanisErdmanis··on Willow, Our Quantum Chip
Wouldn’t thoose increased decoherence times need to be viewed in relation to the time it takes to execute a basic gate? If the time to execute a gate also increases it may overtake practicality of having less noisy logical qubits.
JanisErdmanis··on Willow, Our Quantum Chip
I actually thought the number of logical qubits needed was around 20 for factorisation as the state space size is 2^(2^n) and hence did not recognise them as the number of logical qubits required. It is often misunderstood that error correction needs to be done only once, as with classical quantum computers, and the numbers would fit together with one pass of error correction.

The Shor's algorithm requires binary encoding; hence, 2048 logical qubits are needed to become a nuance for cryptography. This, in turn, means that one will always be easily able to run away from a quantum adversary by paying a polynomial price on group element computations, whereas a classical adversary is exponentially bounded in computation time, and a quantum adversary is exponentially bounded with a number of physical qubits. Fascinating...

JanisErdmanis··on Willow, Our Quantum Chip
The required number of qubits to execute Shor’s algorithm is way larger than 2500 qubits as the error ceiling for logical qubits must decrease exponentially with every logical qubit added to produce meaningful results. Hence, repeated applications of error correction or an increase in the surface code would be required. That would significantly blow up the number of physical qubits needed.
JanisErdmanis··on ChatGPT Pro
They don’t need to downgrade what is already downgraded. In my experience ChatGPT was much more capable a year ago than it is now and have become more dogmatic. Their latest updates have focused on optimizing benchmark scenarios while reducing computation costs.
JanisErdmanis··on Ask HN: Platform for senior devs to learn other programming languages?
This is excellent. I checked Julia which is my main language and all essentials are there. Looked up to Zig, F#, Go all accessible expositions and makes it easy to get a good taste before looking into the manuals.
JanisErdmanis··on Show HN: Rust library for numerical integration of real-valued functions
It looks a bit sloppy to hardcode so many constants in a single file: `src/gauss_quadrature/legendre.rs`. Isn't it possible to generate them with the help of rust macros in the same way Julia uses metaprogramming?
JanisErdmanis··on Artificial Intelligence for Quantum Computing
One thing that comes to my mind and reminds me by looking into the examples is the fragility of existing implementation processes for quantum computers. Pulse optimisation, frequency allocation to minimise cross-talk between qubits, and the development of custom error correction codes tailored for specific quantum computers, circuits, or computations are unpredictable in their successes and, hence, inherently unscalable. It looks like the primary use for AI here is to optimise benchmark results for publishing rather than enable practical quantum computations.
JanisErdmanis··on Choose Boring Technology and LLMs
This completely contradicts my experience using LLMs, indispensable in my workflow for generating Julia code, a young language with little adoption outside its HPC niche. Furthermore, I use Julia for cryptographic software development, which is a niche in itself, and hence, there is no broad learning set from which LLMs could autocomplete.

One of my most impressive uses is for performance optimisation. Claude implemented efficient byte conversion to bigint, and I pasted Julia’s bignum standard base library file, `gmp.jl` to figure out how to do so [1]. Then, a Jacobi symbol calculation function was completely optimised with Calude, and I interactively provided feedback on the functions, correctness, and profiler information on which lines most of the time is spent [2].

Additionally, the OpenSSL wrapper for elliptic curve operations would be beyond my expertise if I hadn’t inquired with Claude about interfacing the OpenSSL_jll library for curve addition and multiplication. This led to the generation of 200 lines of Julia code, which I could execute in the REPL to explore the entire problem space [3]. These pieces were essential to get competitive performance for the ShuffleProofs package [4], where benchmark figures were also asked to be made by Claude with `Luxor`, which is instead a low-level library lovely in itself.

I would be unable to accomplish those improvements alone and would be highly reluctant to learn what a bignum limb is. It would be nearly impossible to implement those optimisations in such a short time while retaining the big picture of the ecosystem I maintain. I also used to have good experiences with ChatGPT at the beginning, but it silently became more dogmatic and lazy over time and somehow lost its ability to apply analogies between `C`, `Java` or `python` ecosystems.

To use LLMs effectively, one needs to interact with them appropriately and be aware of the biases one makes in the questions. Knowing when to make a gentle nudge and when to contradict is a vital skill to have there to get good answers.

[1]: https://github.com/PeaceFounder/CryptoGroups.jl/blob/0f6b4e2...

[2]: https://github.com/PeaceFounder/CryptoGroups.jl/blob/0f6b4e2...

[3]: https://github.com/PeaceFounder/OpenSSLGroups.jl

[4]: https://github.com/PeaceFounder/ShuffleProofs.jl

JanisErdmanis··on Astronomers discover complex carbon molecules in interstellar space
> This discovery also links to another important finding of the last decade – the first chiral molecule in the interstellar medium, propylene oxide. We need chiral molecules to make the evolution of simple lifeforms work on the surface of the early Earth.

It would be really amazing if we were able to know if both chiralities are equally represented in the space. Apart from the life itself it is astonishingly interesting how life evolved to be monochiral.

JanisErdmanis··on Julia 1.11 Highlights
An exciting release with my favourite feature of cache reliability. The arrival of this feature motivated me to making AppBundler.jl, which can bundle GUI applications into familiar installers found on major desktop platforms [1]. I will also enjoy using public keyword when working with submodules to keep APIs more organized. This could also allow to show a tree view of the module functions from `public` and `export` statements.

The `[sources]` in Project.toml is useful feature when retrieving projects without a `Manifest.toml` file. A thing I found missing there, is the lack of integration with `Pkg.add` and `Pkg.dev`, where now I need to manually edit the file to keep those things persistent when `Manifest.toml` is not present. Hopefully, that can be improved with future releases.

I did not understand the ScopedValues example utility. The middleware could handle most of those permission controls by being more explicit with methods `handle_admin` and `handle_guest`. Perhaps someone has a better example where it is really useful.

[1]: https://github.com/PeaceFounder/AppBundler.jl

JanisErdmanis··on Ask HN: What type of Auth are you using on your side projects?
For admin panels, I use SSH port forwarding, as no additional configuration is needed for that. For users, I use email invite codes that contain the hash of the server’s public key and are pasted into a stand-alone client. That way, I don't need to maintain TLS certificates.
JanisErdmanis··on Teenage hacker became a legend attacking companies, then his rivals attacked him
> That only holds if you believe that will (intrinsic or resulting from a cost/benefit analysis) is what's holding back organizations from improving their cybersecurity.

Improvements are expenses. The only unknown here seems to be whether nation-state attackers would recruit these gifted and experienced kids at a rate larger than corporations would be able to improve their security.

JanisErdmanis··on Teenage hacker became a legend attacking companies, then his rivals attacked him
The article mentions NVidia as an example of a ransomware attack. This seems to be a corporate threat.

> I was a member of many video game communities as a kid and DDOS attacks

I agree here that this is a destructive activity with no benefit. Securing games against DDOS attacks seems like a wasted effort.

JanisErdmanis··on Teenage hacker became a legend attacking companies, then his rivals attacked him
They don't end nation-state attacks, but public exposure from teenagers hacking corporate computer systems can make them do their homework of fixing low-hanging vulnerabilities. As a result, the attacks from nation-state attackers could become more expensive.
JanisErdmanis··on Teenage hacker became a legend attacking companies, then his rivals attacked him
This will be controversial, but wouldn’t one be able to say there is a benefit to the society of having kids hacking systems, doing pranks, even collecting ransomware, and not fearing ridiculing their subjects in contrast to having national state attackers that harvest and sell secrets? The first type of attacker would pressure security to be taken seriously, whereas the second type of attack would rarely be noticed and disclosed.
JanisErdmanis··on NumPy QuadDType: Quadruple Precision for Everyone
Unlikely to be user here, just curious. If one would be willing to use numpy_quaddtype with scipy or other libraries that depend on the numpy would that be possible without adding this library as dependency to them?
JanisErdmanis··on The first nuclear clock will test if fundamental constants change
If they detect that the change there would be a strong incentive replicating the setup as well as to put into scrutinity. Academia even with its faults is a very good institution for that.
JanisErdmanis··on Programming Zero Knowledge Proofs: From Zero to Hero
The multiparty setup is better than a singular-party setup, but it burdens its deployment. How can users be confident of at least one party they can trust whose preferences vary? Further, how can deployment be made so that a malicious party does not sabotage the setup process or is sabotaged by the organiser or network failures? In other words, who would need to be blamed? Doing these things properly makes the process’s deployment significantly more expensive than centralised deployment. Hence, I don’t see them bearing any practical relevance, as any authority that organises their deployment would also be subject to cost optimisation due to human nature and as security can’t be quantified, it suffers first.

There are zero-knowledge proofs that don’t require a trusted setup phase. A plain old logarithmic equality proof is a very powerful tool, making it possible to ensure correct reencryption shuffle, decryption or encoding. They don’t get the same appeal as generic ZKP systems that get all the hype, which deters practically-minded people from getting familiar with the mechanisms and opportunities. At least, that was my experience when getting into ZKP.

JanisErdmanis··on Programming Zero Knowledge Proofs: From Zero to Hero
I am also puzzled by this example of utility. It would be easy for the identity provider to separately sign all properties, assign each a unique identifier, and then return them to the users to use the signed identity properties as needed.
JanisErdmanis··on Belenios: Verifiable online voting system
> The list of eligible voters might be not published to protect personal identifiable information and to prevent misuse of such information (in my country it is not published). Therefore you cannot sample anything.

Trusted third-party auditors can have such access without linking the public key to a person's identity. They can also access government databases on a sample basis. This is no different than linking the passport serial number to the person's identity.

JanisErdmanis··on Belenios: Verifiable online voting system
> For comparison, with electronic voting to commit fraud, you need just one patriotic or corrupt system administrator willing to protect the country from an undesirable candidate. It is not difficult to find such type of person.

The difference between having a passport or a national-issued digital identity card that has a private key inside is not much different. In passports, there are different security mechanisms in place that make it hard for an adversary to fake them. For digital identity cards, similar mechanisms exist so that their issuance does not depend on a single entity. The full list for which the identity cards are issued can be audited by sampling and finding follow-ups to see if the issued identity is owned by the claimed legitimate person and is independent, whether the thing is a passport or an identity card. Although, I don't know whether such checks are actually being done in practice. The security of digital identity is being assured with an increasing variety of documents that can be signed digitally using such government-issued cards.

Afterwards, when we have a list of public keys that are eligible to participate in the vote, E2E verifiable evidence prevents any involved party or coalition from deceiving the public with a manipulated election tally, as that would not produce valid cryptographic proof.

← PreviousPage 4 of 10Next →