79466346

Date: 2025-02-25 11:14:59
Score: 7 🚩
Natty: 5
Report link

When executing the script using this method, the following encoding error occurred: Error: invalid byte sequence in UTF-8

I generated a key using the following method and used it to create a signature, then utilized the signature as the token to connect to ElastiCache, but encountered persistent errors.

 signing_key=$(printf "AWS4$aws_access_key_id")
 signing_key=$(echo -n "$datestamp" | openssl dgst -sha256 -mac HMAC -macopt key:"$signing_key" | cut -d' ' -f2)
 signing_key=$(echo -n "$aws_region" | openssl dgst -sha256 -mac HMAC -macopt key:"$signing_key" | cut -d' ' -f2)
 signing_key=$(echo -n "$service" | openssl dgst -sha256 -mac HMAC -macopt key:"$signing_key" | cut -d' ' -f2)
 signing_key=$(echo -n "aws4_request" | openssl dgst -sha256 -mac HMAC -macopt key:"$signing_key" | cut -d' ' -f2)
signature=$(echo -en "$string_to_sign" | openssl dgst -sha256 -sign "$signing_key"| cut -d' ' -f2)

Could you help me analyze the specific cause of the error? thanks so much.

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Blacklisted phrase (1): help me
  • RegEx Blacklisted phrase (3): Could you help me
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): When
  • Low reputation (1):
Posted by: libra ma