Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. JSON Request Payload :

    Code Block
    {
      "api-version": "1.0",
      "security-id": "5c45a01919eab5c4b0ce5484daf8105bc2bbb7bd0e958cb122864c67ac249322",
      "flow-id": "ZH0RKJvh",
      "calls": [
        {
          "client-identifier": "7845sdwq",
          "start-time": "2022-01-23T08:02:53.311+05:30",
          "contact-numbers": [
            "7016225597"
          ],
          "keys": []
        }
      ]
    }

  2. Base64 Encoded json payload:

    Code Block
    ewogICJhcGktdmVyc2lvbiI6ICIxLjAiLAogICJzZWN1cml0eS1pZCI6ICI1YzQ1YTAxOTE5ZWFiNWM0YjBjZTU0ODRkYWY4MTA1YmMyYmJiN2JkMGU5NThjYjEyMjg2NGM2N2FjMjQ5MzIyIiwKICAiZmxvdy1pZCI6ICJaSDBSS0p2aCIsCiAgImNhbGxzIjogWwogICAgewogICAgICAiY2xpZW50LWlkZW50aWZpZXIiOiAiNzg0NXNkd3EiLAogICAgICAic3RhcnQtdGltZSI6ICIyMDIyLTAxLTIzVDA4OjAyOjUzLjMxMSswNTozMCIsCiAgICAgICJjb250YWN0LW51bWJlcnMiOiBbCiAgICAgICAgIjcwMTYyMjU1OTciCiAgICAgIF0sCiAgICAgICJrZXlzIjogW10KICAgIH0KICBdCn0=

  3. AES Encryption of base encoded JSON payload:

    Code Block
    Need one key: You can generate any random key (6-8 digit) abcd1234
    AES base64 encoded key - YWJjZDEyMzQ=
    Apply AES encryption on base64 encoded json payload using base64 encoded aes key
    

  4. Testing API to convert encryption request payload to encrypted data:

    Code Block
    URL:https://central-awsdev.phonon.io/kairos-apis/enc/outbound/encryptdata 
    request:
    {
    "requestValue":"ewogICJhcGktdmVyc2lvbiI6ICIxLjAiLAogICJzZWN1cml0eS1pZCI6ICI1YzQ1YTAxOTE5ZWFiNWM0YjBjZTU0ODRkYWY4MTA1YmMyYmJiN2JkMGU5NThjYjEyMjg2NGM2N2FjMjQ5MzIyIiwKICAiZmxvdy1pZCI6ICJaSDBSS0p2aCIsCiAgImNhbGxzIjogWwogICAgewogICAgICAiY2xpZW50LWlkZW50aWZpZXIiOiAiNzg0NXNkd3EiLAogICAgICAic3RhcnQtdGltZSI6ICIyMDIyLTAxLTIzVDA4OjAyOjUzLjMxMSswNTozMCIsCiAgICAgICJjb250YWN0LW51bWJlcnMiOiBbCiAgICAgICAgIjcwMTYyMjU1OTciCiAgICAgIF0sCiAgICAgICJrZXlzIjogW10KICAgIH0KICBdCn0=",
    "aesKey":"abcd1234",
    "flowID":"ZH0RKJvh"
    }
    Response:
    {
    "flowID": "ZH0RKJvh",
    "requestEncryptedValue": "pIisitW+w8s2Dz4NfUm3EH2RnBU/X2HctqMmgheJI/dVsyDSKDPKBbydBLsQuNTqioA2wYjENo1EyH9ZXol3NNuWtR5yhcQFHPvcJGOQw7DCHe6FfRIFaAiYyz/dYMhVICrDKhmVyAcaZkBkFkjvE9IuvaIqNDb3fWRW2faO4+IRgYkh/701mAIqMYohFWWP+JmIbah+VpaQ6SoHYR+JjHNuXmKq8KkrCJOTlCyakX/u05vmWr/h8TQmgo+XLJaygrcQf2oJFreWqarFyk4CsQV4XhCoyia0PK7r6Wb1f5qC3oofPG3dE1mYrya+96bVcBVFj0MCFQvLRUQ7LLNAkf0XfWMFNVOtoBd7iGHY7K8jvX46sQ1jA3SDpcVwMsP/OtQCK1r0oClRCBjWo6C0BIwVomstjSdGvIM4buwSgBQUIri4deAaFFmR0yOIIJyF/Ytg+h2aWnOTK0LLC6TNpHhmyWxwTd0QJnoUT4ob11BgOBqYigCnQTCWzhslcK6veeuxADmiykq/36SxIgispNigMW8nUTEhiP+b9TyKPsIl1fxMRFsVvtWKbyK78/mNWbCUic3bpOX+i6M7l+pdFg==",
    "requestDigitalSignatureValue": "dlUetVwjP4GFx6064lHMrXLtKYx+A7+TKHZQvhmJ60Rbxc1lV4eslwG47OglT/zqyrpa56/9LSnd0HjF6gp3eqTIsaKqXUv9eFXp8IgxR7NIjwebnVNW0LxYmgM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ob11BgOBqYigCnQTCWzhslcK6veeuxADmiykq/36SxIgispNigMW8nUTEhiP+b9TyKPsIl1fxMRFsVvtWKbyK78/mNWbCUic3bpOX+i6M7l+pdFg==

  6. After RSA encryption on AES base64 encoded key:

    Code Block
    ClKdnVq3RBlzOiVaOU83prMrq9JfABjK+oYZcMI/Odcs+rmsxV9u8rlScdX1CQDNA2cyLSSVDLbcA0oB2MTikVTorsohjI0c9NxnxpAOw/jCQmepb6Ix9FIoJo+B3rjyxiwBR8MHLc+1cL1eNaKexx+TVgtjKZjLfu85efnkupZ65Vo80xuMqY+VE4lyKAIswMvWqvpBbhMBsbBsq5Po6GZATTf+A76Mo42k4N43V/gPdysZ8IcP6Wi1bLm+jcZuudsD1zrbPebnRxGlZZqKOBmQhe1iPxdQ3DViZEZzjEoCSWIUqhC5wwyFdmRbH3HuUdWV7qg7te9kOxy2RWnEep1vfd/60Gpvl7GrUvS1sSq20wDCELz7tKbL3YQAUgwMpwtAxDVweo+a26Ko4lcKNhMcwpCItmQqSQkByWlJCEb10edNuxtxup4LtDF/kH1mNWnwNYvnxo3OVyL9k3OBzdBqAzKO7aSEY8Hm1WZorSksEqxQ1z0OUQZFvrJFWsEH3opDGU2TS11VHgl9pg7BTDZpnXvZiIBFivB2Coa61EgBiROoVdaHBb8rF9Cy4kN8bcye3hZQh5Oq37/wJLDjEefisXpRm4qfQMtSZ6Yb/kLs3TD6+75m9LggYSXrxSmPlbrjWGY0tXBzN8hGW0xRhURuYESuDYH3L6WpG1JNZ54=

  7. New encrypted request format:

    Code Block
    {
      "requestEncryptedValue": "pIisitW+w8s2Dz4NfUm3EH2RnBU/X2HctqMmgheJI/dVsyDSKDPKBbydBLsQuNTqioA2wYjENo1EyH9ZXol3NNuWtR5yhcQFHPvcJGOQw7DCHe6FfRIFaAiYyz/dYMhVICrDKhmVyAcaZkBkFkjvE9IuvaIqNDb3fWRW2faO4+IRgYkh/701mAIqMYohFWWP+JmIbah+VpaQ6SoHYR+JjHNuXmKq8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"flowID": "ZH0RKJvh"
    }

  8. Invoke kairos API:

    Code Block
    Sample API for Outbound flow.
    URl: https://central-awsdev.phonon.io/kairos-apis/enc/outbound/create
    Request:
    {
      "requestEncryptedValue": "pIisitW+w8s2Dz4NfUm3EH2RnBU/X2HctqMmgheJI/dVsyDSKDPKBbydBLsQuNTqioA2wYjENo1EyH9ZXol3NNuWtR5yhcQFHPvcJGOQw7DCHe6FfRIFaAiYyz/dYMhVICrDKhmVyAcaZkBkFkjvE9IuvaIqNDb3fWRW2faO4+IRgYkh/701mAIqMYohFWWP+JmIbah+VpaQ6SoHYR+JjHNuXmKq8KkrCJOTlCyakX/u05vmWr/h8TQmgo+XLJaygrcQf2oJFreWqarFyk4CsQV4XhCoyia0PK7r6Wb1f5qC3oofPG3dE1mYrya+96bVcBVFj0MCFQvLRUQ7LLNAkf0XfWMFNVOtoBd7iGHY7K8jvX46sQ1jA3SDpcVwMsP/OtQCK1r0oClRCBjWo6C0BIwVomstjSdGvIM4buwSgBQUIri4deAaFFmR0yOIIJyF/Ytg+h2aWnOTK0LLC6TNpHhmyWxwTd0QJnoUT4ob11BgOBqYigCnQTCWzhslcK6veeuxADmiykq/36SxIgispNigMW8nUTEhiP+b9TyKPsIl1fxMRFsVvtWKbyK78/mNWbCUic3bpOX+i6M7l+pdFg==",
      "requestDigitalSignatureValue": "ClKdnVq3RBlzOiVaOU83prMrq9JfABjK+oYZcMI/Odcs+rmsxV9u8rlScdX1CQDNA2cyLSSVDLbcA0oB2MTikVTorsohjI0c9NxnxpAOw/jCQmepb6Ix9FIoJo+B3rjyxiwBR8MHLc+1cL1eNaKexx+TVgtjKZjLfu85efnkupZ65Vo80xuMqY+VE4lyKAIswMvWqvpBbhMBsbBsq5Po6GZATTf+A76Mo42k4N43V/gPdysZ8IcP6Wi1bLm+jcZuudsD1zrbPebnRxGlZZqKOBmQhe1iPxdQ3DViZEZzjEoCSWIUqhC5wwyFdmRbH3HuUdWV7qg7te9kOxy2RWnEep1vfd/60Gpvl7GrUvS1sSq20wDCELz7tKbL3YQAUgwMpwtAxDVweo+a26Ko4lcKNhMcwpCItmQqSQkByWlJCEb10edNuxtxup4LtDF/kH1mNWnwNYvnxo3OVyL9k3OBzdBqAzKO7aSEY8Hm1WZorSksEqxQ1z0OUQZFvrJFWsEH3opDGU2TS11VHgl9pg7BTDZpnXvZiIBFivB2Coa61EgBiROoVdaHBb8rF9Cy4kN8bcye3hZQh5Oq37/wJLDjEefisXpRm4qfQMtSZ6Yb/kLs3TD6+75m9LggYSXrxSmPlbrjWGY0tXBzN8hGW0xRhURuYESuDYH3L6WpG1JNZ54=",
      "flowID": "ZH0RKJvh"
    }
  9. Take flowid: ZH0RKJvh
    Fetch public-private key of a given flow. (ZH0RKJvh_public.key,ZH0RKJvh_private.key) (Path of keys: /home/PHONON/)

  10. RSA decryption of digital signature:

    Code Block
    service will use: ZH0RKJvh_private.key for decryption
    service will get AES base64 encoded key: YWJjZDEyMzQ=

  11. AES decryption using AES base64encoded key: YWJjZDEyMzQ=

    Code Block
    AES Decrypted json request payload: 
    ewogICJhcGktdmVyc2lvbiI6ICIxLjAiLAogICJzZWN1cml0eS1pZCI6ICI1YzQ1YTAxOTE5ZWFiNWM0YjBjZTU0ODRkYWY4MTA1YmMyYmJiN2JkMGU5NThjYjEyMjg2NGM2N2FjMjQ5MzIyIiwKICAiZmxvdy1pZCI6ICJaSDBSS0p2aCIsCiAgImNhbGxzIjogWwogICAgewogICAgICAiY2xpZW50LWlkZW50aWZpZXIiOiAiNzg0NXNkd3EiLAogICAgICAic3RhcnQtdGltZSI6ICIyMDIyLTAxLTIzVDA4OjAyOjUzLjMxMSswNTozMCIsCiAgICAgICJjb250YWN0LW51bWJlcnMiOiBbCiAgICAgICAgIjcwMTYyMjU1OTciCiAgICAgIF0sCiAgICAgICJrZXlzIjogW10KICAgIH0KICBdCn0=

  12. The original request JSON payload

    Code Block
    Service wil apply base64 decode on AES decrypted request payload and get orginal JSON request payload.
    {
      "api-version": "1.0",
      "security-id": "5c45a01919eab5c4b0ce5484daf8105bc2bbb7bd0e958cb122864c67ac249322",
      "flow-id": "ZH0RKJvh",
      "calls": [
        {
          "client-identifier": "7845sdwq",
          "start-time": "2022-01-23T08:02:53.311+05:30",
          "contact-numbers": [
            "7016225597"
          ],
          "keys": []
        }
      ]
    }

  13. Once the service will receive a normal SON request payload it will apply a normal API process on it and revert the appropriate response.

...