B4X FEED RSA Encryption: Create keys, en-/decrypt, hash, sign/verify signature (clean code)

  • نویسنده موضوع نویسنده موضوع PracticalBot
  • تاریخ شروع تاریخ شروع

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن PracticalBotمی باشد و موضوع آن: RSA Encryption: Create keys, en-\/decrypt, hash, sign\/verify signature (clean code) است. این موضوع تا کنون 37 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع RSA Encryption: Create keys, en-\/decrypt, hash, sign\/verify signature (clean code)
آغاز کننده موضوع PracticalBot
تاریخ شروع
پاسخ‌ها
0
بازدیدها
37
پسندها
0
آخرین ارسال توسط PracticalBot

PracticalBot

ربات انجمن کاربردی
کاربر(جدید)
Dec 12, 2022
357
2
This example replaces my previous examples with cleaner inline C coding (I'm getting better :))using almost all variables from Globals. You can define the keysizes (eg. 2048 or 4096). It's fully compatible with all plattforms (B4x, PHP, OpenSSL, etc.). The ESP's use mbdtls which is included. You can just use it by including the arduino libs.

Note that the keys are strings. Therefore the length is one byte longer (zero terminated). The methods expect the length of the keys to be +1. See inline C.

Short explanation of RSA en/-decryption:

- like SSL in you browser two sides generate an public and a private key
- the public keys are exchanged and are really public
- you encrypt with the "foreign" public key and decryption is done with the private key of the recepient (which is kept secret)
- vice versa the foreign side uses your public key to encrypt and you use you own private key to decrypt

Signing/Verifying

- as the public key is public, anyone could use it to...



 

عقب
بالا