Learn how to decrypt Onboardbase secrets coming directly in a Ruby environment

Install CryptoJSAESDecrypt via Ruby Gems

gem install cryptojs-aes-decrypt

Fetch Your Secrets From Onboardbase Public API

Refer to this API resource on how you can retrieve your secrets from Onboardbase. Your response should contain an array of secrets you have created as seen below

{
    "status": "success",
    "message": "Secret successfully fetched",
    "data": {
        "project": "my-project",
        "environment": "development",
        "secrets": [
           "your secret",
        ]
    }
}

Your secrets are encoded using AES-CBC (Cypher Block Chaining) cryptographic algorithm. To decode these secrets, you will need your API KEY passcode. A passcode is an alphanumeric value that you provided when generating your API KEY from your Onboardbase account settings.

To read more about authentication, Click here

require 'cryptojs-aes-decrypt'

# Original Cipher
cipher = 'your secret'
# The passphrase that generated the cipher above
passphrase = 'passcode'
# Run the decryption
decrypted = CryptojsAesDecrypt.run(cipher, passphrase)
# p expected
# Outputs -> '{"id":"0a09a9e1-eee2-4a8e-bf77-901be943621c","key":"WHAT","value":"IS_THIS_NAH","comment":"","addedBy":{"name":"Aleem Isiaka","id":"a3748a40-3ab8-4dd1-bac6-e73c1047c95f"},"addedDate":"April 22, 2022 | 20:09 GMT","method":""}'