Appendix. How to encrypt the DB user password
This document provides guidance on how to encrypt a DB user password.
caution
The user.password
field must contain an encrypted value for proper creation.
Prerequisites
Example Python code for encrypting the DB user password
Here is an example of Python code for encrypting the required DB user password.
You can run the example code below using the attached public key and input the desired password to get the encrypted result.
Use the encrypted result as the user.password
field value when creating an instance group/cluster.
Code Example: encrypt database user password
memstore_pub_key.pem file
-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEAr4mgZ4SFzTEtgdh3WZSWgMF/l6PhR9gdeq8jwP2BlyWW06UgZPhL
jKi+o3rbCWtpARtpn9ik1DKfG2ZQOempPlBv70JZMqzuvZcDueQdihRS2isCq5rS
6V40S8eq3UIi80UVS6U3hIFA0y3uNMREW1ny5H4nw2IQUIXm7W2KSIc57JE4uIu9
cmNvG1uwbBuj49JUUmHIgxd9FYURxeVyuwc5CO9uA5tXTYPePtOSXQs4SnoEJK+o
t+EQMBpokaUe/UYHjr4z68Lz8V+3r62bkfFr5dN5MsVpAeOMHp0az3H2uIfU8JQa
6FNZ7BJcuEP8ezEL6GQUkLJ8P0tQQ/5spQIDAQAB
-----END RSA PUBLIC KEY-----
Result Example
Result example
test@test-macbook ~ % ./memstore_dbuser_password_encrypt.py
Enter KC memstore DBUser Password: kcmemstore123$
Encrypted text : QEmUQjAZqAHEBpdiVlok/9l6fDKM6f0Q60S35pQmB/KILKf5c3SrcbWv55H1fu+EevKVeA1cCNzgJxz0rMMdtgPE5zoBX2c6cQoUqsUZ0g9e3pAg3WEt70HxMfxyVy1WY2TNe2uic6l0+Nx+cIdIBJcBpJ+OQQTrSdCDDLUQRnrnhuPqnyXvdgP0tXjgpKzmfLsjebJS9Wa+8TY9ee6oBLx5F2+XMjDFapw4hXfbSwKUWDFK+czTa11zwYDpMdwmISVWwX9e77rfZg7f9sfsd2+lzbFj52LORf1CF2DGzgqP3I3xSf+0KiekwwAy3Kca5EHkyqK7mWeXMeKk7qnWjQ==