title: Constructing AWS S4 authentication in python
body: <p>I'm trying to create S4 signatures as outlined <a href="https://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html#signature-v4-examples-python" rel="nofollow noreferrer">here</a> using the python code snippet. The documentation is confusing me so I wanted some clarity on the following</p>
  
  <p>1) The getSignatureKey method is signing 4 inputs, but the output they have shown has an extra kSecret. What is this kSecret?</p>
  
  <p>2) When I run the program, the output I get is like this:</p>
  
  <pre><code>kDate = '\x96\x9f\xbb\x94\xfe\xb5B\xb7\x1e\xdeo\x87\xfeM_\xa2\x9cx\x93B\xb0\xf4\x07GFp\xf0\xc2H\x9e\n\r'
  </code></pre>
  
  <p>whereas the output as per the documentation is like this:</p>
  
  <pre><code>kDate    = '969fbb94feb542b71ede6f87fe4d5fa29c789342b0f407474670f0c2489e0a0d'
  </code></pre>
  
  <p>Which is the correct format to be used? How to get one from the other?</p>
  
  <p>3) It appears that the output values are also different (if I strip away the \x). Is this a documentation error? </p>
  
  <p>I am using python 2.7</p>