2013-05-17 2 views
6

Ich versuche, eine Art von Referenz für die CommonCrypto-Bibliothek des Apple zu finden, weil Apple offenbar keinen offensichtlichen Link dafür hat, und die von Google sind veraltet, wie dieser unten:iOS CommonCrypto Referenz

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/Common%20Crypto.3cc.html

Hinweise dazu? Gibt es eine bessere Bibliothek, die ich verwenden könnte, um eine App mit vielen kryptografischen Funktionen zu entwickeln?

Danke.

+0

Ja, ich habe das gleiche Problem. Konnte keine Informationen zu CommonCrypto finden – Mike

+0

Der Link in der Frage enthält Links zu den verschiedenen kryptografischen Primitiven. Von unten nach oben sind die gelinkten Seiten Links zu: CC_MD5, CC_SHA, CCHmac, CCCryptor. – zaph

+0

Haben Sie viele kryptografische Erfahrungen mit "vielen kryptografischen Funktionen"? – zaph

Antwort

4

Die meisten Informationen, die sie bereitstellen, befinden sich in den Anfangszeilen der Headerdatei. Halten Sie die Befehlsschaltfläche gedrückt und klicken Sie auf "CommonCrypto/CommonCryptor.h", um darauf zuzugreifen.

/*! 
@header  CommonCryptor.h 
@abstract Generic interface for symmetric encryption. 

@discussion This interface provides access to a number of symmetric 
      encryption algorithms. Symmetric encryption algorithms come 
      in two "flavors" - block ciphers, and stream ciphers. Block 
      ciphers process data (while both encrypting and decrypting) 
      in discrete chunks of data called blocks; stream ciphers 
      operate on arbitrary sized data. 

      The object declared in this interface, CCCryptor, provides 
      access to both block ciphers and stream ciphers with the same 
      API; however some options are available for block ciphers that 
      do not apply to stream ciphers. 

      The general operation of a CCCryptor is: initialize it 
      with raw key data and other optional fields with 
      CCCryptorCreate(); process input data via one or more calls to 
      CCCryptorUpdate(), each of which may result in output data 
      being written to caller-supplied memory; and obtain possible 
      remaining output data with CCCryptorFinal(). The CCCryptor is 
      disposed of via CCCryptorRelease(), or it can be reused (with 
      the same key data as provided to CCCryptorCreate()) by calling 
      CCCryptorReset(). 

      CCCryptors can be dynamically allocated by this module, or 
      their memory can be allocated by the caller. See discussion for 
      CCCryptorCreate() and CCCryptorCreateFromData() for information 
      on CCCryptor allocation. 

      One option for block ciphers is padding, as defined in PKCS7; 
      when padding is enabled, the total amount of data encrypted 
      does not have to be an even multiple of the block size, and 
      the actual length of plaintext is calculated during decryption. 

      Another option for block ciphers is Cipher Block Chaining, known 
      as CBC mode. When using CBC mode, an Initialization Vector (IV) 
      is provided along with the key when starting an encrypt 
      or decrypt operation. If CBC mode is selected and no IV is 
      provided, an IV of all zeroes will be used. 

      CCCryptor also implements block bufferring, so that individual 
      calls to CCCryptorUpdate() do not have to provide data whose 
      length is aligned to the block size. (If padding is disabled, 
      encrypting with block ciphers does require that the *total* 
      length of data input to CCCryptorUpdate() call(s) be aligned 
      to the block size.) 

      A given CCCryptor can only be used by one thread at a time; 
      multiple threads can use safely different CCCryptors at the 
      same time.    
*/ 
+0

Danke für die Antwort! – anavarroma

0

Die manpages hierfür sollte helfen.

+0

Eigentlich der Link die Frage verweist auf die gleiche Apple-Dokumentation. – zaph

+2

Die Verbindung ist schlecht geworden. – zaph

4

Es gibt ein gutes Beispielprojekt namens CryptoCompatibility, das Sie über Xcode finden und herunterladen können. Es ist besser, daraus zu lernen, als nur die Header-Dateien zu betrachten. Suchen Sie einfach in der Dokumentation & API Referenzfenster.

Verwandte Themen