377 похожих чатов

Немного абстрактный вопрос про RSA подпись (ЭЦП) и попытку использования

hmac вместо нее

представьте что для задачи я собираюсь хранить в бд записи вида
data = {user: aaaa, value: 1000}
подписанные приватным ключем юзера на стороне юзера
signedData = {user: aaaa, value: 1000, sig: 0xBBBB}



вопрос - можно ли как-то это дело ускорить если хранить что-то вроде HMAC
сделанного так - что
hmacValue = hmacCalculate (userPass1, data) = 0xAA
signedData = {user: aaaa, value: 1000, hmac: 0xAA}

и потом проверить одобрил ли юзер эти данные- мы спросим у юзера userPass1
и посчитаем
isGoodHMac(userPass1, data, hmacValue)


цель - не использовать подпись тк это медленно (и подписывать и проверять )


UPD чат гпт говорит что никак - но у меня нет высоких требований к безопасности и к тому что юзер может потом утверждать что он это не подписывал

Can an RSA private key signature be substituted with an HMAC for optimization?

ChatGPT
RSA private key signatures and HMACs (Hash-based Message Authentication Codes) serve different purposes and cannot be directly substituted for each other.

RSA is an asymmetric cryptographic algorithm that relies on a pair of keys: a public key for encryption or signature verification and a private key for decryption or signature generation. RSA signatures provide non-repudiation, meaning the signer cannot later deny having signed the message since only they possess the private key.

HMAC, on the other hand, is a symmetric cryptographic algorithm that uses the same key for both generating and verifying a message authentication code. It is used to ensure the integrity and authenticity of a message between two parties that share a secret key. However, HMAC does not provide non-repudiation, as any party possessing the shared secret key could have generated the HMAC.

While HMAC is generally faster than RSA signatures, you cannot directly substitute an RSA private key signature with an HMAC for optimization without sacrificing the security properties provided by RSA signatures. If you need to optimize performance, you may consider other options such as:

Using elliptic curve cryptography (ECC) instead of RSA, as it offers comparable security with smaller key sizes and faster operations.
Offloading cryptographic operations to dedicated hardware or cryptographic accelerators.
Employing a hybrid approach, using symmetric encryption (like AES) for bulk data encryption and asymmetric encryption (like RSA or ECC) for key exchange and digital signatures.

1 ответов

28 просмотров

Подпись и имитовставка служат всё-таки для разных вещей. Что требуется обеспечить? К слову, вычисление имитовставки -- тоже не самая быстрая операция

Похожие вопросы

Обсуждают сегодня

@MrMiscipitlick А можешь макрос написать, который будет вычислять смещение относительно переданных меток? Просто .label1-.label2, и вернуть значение.
КТ315
35
я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
А еще в перле можно уже @arr1 + @arr2?
Sergei Zhmylove
53
Подобного рода ;Следующие три строки это директивы ассемблера, ;которые можно не задавать, т.к.работаем в Visual Studio. ;Символ ";" - это начало однострочного комментария ...
Егор Анелькин
3
I arrived here after a Chico Crypto show highlighted the project & the Team - the fact that the Team had a long history of successfully working with household names gave me e...
Banter is Bullish
5
Dear super pioneers 🥳🥳: I want to purchase a hosting plan for a website where video games, metaverse, AI avatars, videos, and heavy virtual twins can be uploaded, which I wan...
Guapi
10
Привет всем. появился вопрос. Разрабатываю сайт, в данный момент он запущен. Хостинг beget. Добавляю на сайт яндекс метрику с помощью полей client-settings (взято отсюда http...
Andrew
2
еще вопрос, допустим мы создадим char массив из 10 элементов и присвоим ему через сканф 10 символов. и выведем все символы. Хотел спросить последний элемент /0 будет включать...
Anthem
10
Подскажите, где смотреть результат выполнения программы? Код: ;.686 ;Система команд процессора 686 ;.MODEL FLAT,stdcall ;Модель памяти плоская, станда...
Егор Анелькин
5
открыть папку в проводнике: 1 - ShellExecute 2 - ExecuteProcess 3 - OpenDocument что лучше выбрать?
Alexey Kulakov
12
Карта сайта