Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README-RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,21 @@ secure_buffer key(std::move(secret_string)); // обнуляет перемещ
auto mac = hmac::get_hmac(key, payload, hmac::TypeHash::SHA256);
```

Для дополнительной защиты в памяти можно использовать `hmac_cpp::secret_string`, который
обфусцирует данные и по возможности закрепляет их в RAM:

```cpp
#include <hmac_cpp/secret.hpp>

hmac_cpp::secret_string token("super-secret-token");

token.with_plaintext([](const uint8_t* p, size_t n){
// p действует только внутри коллбэка
});

token.clear();
```

### HMAC (сырой буфер)

```cpp
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,21 @@ secure_buffer key(std::move(secret_string)); // zeroizes moved-from string
auto mac = hmac::get_hmac(key, payload, hmac::TypeHash::SHA256);
```

For additional protection in memory, `hmac_cpp::secret_string` obfuscates
the data and tries to keep it locked in RAM:

```cpp
#include <hmac_cpp/secret.hpp>

hmac_cpp::secret_string token("super-secret-token");

token.with_plaintext([](const uint8_t* p, size_t n){
// p is valid only inside the callback
});

token.clear();
```

### HMAC (raw buffer)

```cpp
Expand Down
Loading