title: how can I translate a NSString to NSData? And the data has the same content as the string
body: <pre><code>NSString * theString=@"e88d";
  NSData * data;
  
  // something I should implement
  
  NSLog(@"%@", theString);
  
  NSLog(@"%@",[data description]);
  </code></pre>
  
  <p>I want the results of the two printings to be the same. </p>
  
  <hr>
  
  <p>AES encryption and decryption:</p>
  
  <p>(1).The server:</p>
  
  <p>If the plaintext is <code>@"abcd";</code></p>
  
  <p>The AES encrypted <code>data(NSData data type)</code> is <code>"d882830c dc892036 4345839f 13c7516a"</code></p>
  
  <p>(2).in my local app, my code is:</p>
  
  <pre><code>NSData*data=[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://..."]]; 
  NSString * mystring= [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  </code></pre>
  
  <p>However, to decrypt data successfully, I must have a <code>data(NSData date type)</code> which equals to <code>"d882830c dc892036 4345839f 13c7516a"</code>. But it is the <code>mystring(NSString data type)</code> not the <code>data(NSData data type)</code> that equals the right value.</p>
  
  <p>The encryption and decryption function both need a <code>data(NSData data type)</code> as input datas.</p>
  
  <pre><code>- (NSData*)AES128EncryptWithKey:(NSString*)key;
  - (NSData*)AES128DecryptWithKey:(NSString*)key;
  </code></pre>