crypto-rsa-attacks
Break RSA when parameters or padding are weak — recover plaintext or the private key from a public key and ciphertext. Load when you meet RSA in auth/tokens/TLS/custom crypto and have (n, e) + a ciphertext. Signals: a public key or n/e/c values, small exponent e=3, "textbook RSA", a JWT signed RS256
v2026.10.14-ee0e0c53 установки+3 за 7 дней27 ЗвездыMITсинхронизировано 22 часа назад
Установка
Ещё нет NotHoly CLI? Сначала установите её.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install noorqureshi/crypto-rsa-attacksПишет в ~/.notholy/skills после проверки подписи и SHA-256.
ПодписьПодписано, ed25519
Пакетad8308ad…e2824db5
ad8308ad4e23…bc26e2824db51 файл · 2.0 KBПроверкаНизкийзамечаний нет
Источникgithub.com/NoorQureshi/security-skills/tree/main/skills/cryptography/crypto-rsa-attacks@ee0e0c5
Эта запись еще не переведена на русский, поэтому показан текст на другом языке: English.
На странице
When it applies
RSA is used somewhere you can reach on an authorized target — a session token/cookie, a licence
check, a custom API request signature, a JWT (RS256), or an exposed keypair — and you can read the
public key (n, e) and a ciphertext/signature. Real systems get RSA wrong in a handful of
repeatable ways; each has a direct recovery.
Why it works
RSA is only as strong as its parameters and padding. "Textbook" RSA (no OAEP/PSS) is malleable and deterministic, small or shared parameters are mathematically reversible, and a factorable modulus hands you the private key outright. You don't break RSA — you exploit the specific weakness in this key.
Method
- Extract parameters. From a PEM:
openssl rsa -pubin -in key.pem -text -noout(givesn,e). From a JWT: decode the header/key. Noteeand the bit-length ofn. - Match the weakness → attack:
- Factorable
n— look it up on factordb; small/knownnfactors instantly → derived. - Close primes (p≈q) — Fermat factorisation recovers
p,qin milliseconds. - Small
e(e=3) + small message — plaintext may be< n^(1/e); take the integer cube root ofc(no modular reduction happened). Also Håstad broadcast if the same msg is sent to several keys. - Shared prime across two keys —
gcd(n1, n2)yields a common factor → both keys fall. - Common modulus (same
n, twoewith gcd 1 on the same message) — combine with Bézout. - Small private exponent
d— Wiener's attack (continued fractions). - Textbook (no padding) — malleable: forge/blind via
c' = c·r^e mod n; deterministic encryption enables chosen-ciphertext games.
- Factorable
- Automate the triage with RsaCtfTool (
rsactftool --publickey key.pem --uncipher cruns the above battery), then finish by hand once you know which weakness hit. - Recover and use — with
p,q:d = e^-1 mod (p-1)(q-1), decryptc, or re-sign to forge a token/signature.
Gotchas
- Proper padding (OAEP/PSS) with strong random primes ≈ unbreakable — don't burn time; the win is a misconfiguration, not the algorithm. Confirm it's textbook/weak first.
eanddare inverses mod φ(n) — a wrong φ (usingninstead of(p-1)(q-1)) gives a key that "looks" right but fails; verify by decrypting a known value.- JWT RS256 → key confusion is a different bug (alg swap to HS256) — see
web-auth-jwt; this skill is for weak RSA keys themselves. - Endianness / block size when converting the integer back to bytes trips people up
(
long_to_bytes).
Verify success
Recovered plaintext that is meaningful (or a forged signature/token the target accepts), and — when
you factored n — a private key that correctly decrypts a value you can check.
References
RsaCtfTool; factordb; Boneh "Twenty Years of Attacks on RSA"; Wiener's attack; pycryptodome.
Related: web-auth-jwt, crypto-oracle-attacks.
Файлы этой версии
- SKILL.md3.6 KB
Права
| Право | Заявлено | Найдено проверкой |
|---|---|---|
| Читает файлы | Нет | Нет |
| Пишет файлы | Нет | Нет |
| Выполняет команды shell | Нет | Нет |
| Ходит в сеть | Нет | Нет |
| Использует коннекторы | Нет | Нет |
| Управляет браузером | Нет | Нет |
Замечания проверки
Проверено 13 нояб. 2026 г.
Проверка не нашла в этой версии ничего подозрительного.
Чистая проверка снижает риск, но не доказывает, что пакет безопасен. Читайте то, что ставите.
| Версия | Опубликована | Коммит | SHA-256 | Подпись | Изменение прав |
|---|---|---|---|---|---|
| v2026.10.14-ee0e0c5 | 13 нояб. 2026 г. | ee0e0c5 | ad8308ad | Подписана | – |
Ещё от NoorQureshi
Всё от этого издателяЕще в категории «Криптография и Web3»
Вся категорияСпрашивайте обо всём, что позволяет ваш скоуп.
Создайте аккаунт, пополните баланс и задайте первый вопрос в чате или в терминале.
- 1/3
Создайте аккаунт
Личный или для компании. Позже можно перейти на аккаунт компании без потери баланса и ключей.
ЛичныйКомпания - 2/3
Пополните баланс
Картой. Оплата за токены, без подписки.
$5.00минимальное пополнение - 3/3
Спрашивайте
В чате, или установите CLI и выполните notholy login в терминале.
$ notholy login