Skip to content

Commit 39576a8

Browse files
authored
Simplify Secret Generation Commands (#145)
When base64 encoding, every 6 bytes of input is turned into 8 bytes of output. In our examples 24 bytes of input is turned into 32 bytes of output. For gpg example we use --armor flag to base64 encode the output.
1 parent 6809a07 commit 39576a8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

plugins/jwt-auth/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ The `secret` string is required when using HMAC. The secret should not be commit
5454
characters long. You can generate a strong secret using a tool like openssl or gpg:
5555

5656
```console
57-
openssl rand -base64 32 | cut -c1-32
57+
openssl rand -base64 24
5858
```
5959

6060
```console
61-
gpg --gen-random 1 32 | base64 | cut -c1-32
61+
gpg --armor --gen-random 1 24
6262
```
6363

6464
#### keys

plugins/jwt-auth/assets/mixerapi_jwtauth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/*
1414
* This is only required if you are using HMAC, it can be left empty otherwise. The value must be at least
1515
* 32 characters long, secure, and not be committed to your VCS. You can generate a secure secret using
16-
* something like `openssl rand -base64 32` or `gpg --gen-random 1 32 | base64`
16+
* something like `openssl rand -base64 24` or `gpg --armor --gen-random 1 24`
1717
*/
1818
'secret' => null, // file_get_contents(CONFIG . 'keys' . DS . 'hmac_secret.txt'),
1919

0 commit comments

Comments
 (0)