• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2
3
4
5<!DOCTYPE html>
6<html lang="en">
7<head>
8  <meta charset="utf-8"  />
9  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no"  />
10  <title>ImageMagick - MagickCore, C API: Convert to and from Cipher Pixels</title>
11  <meta name="application-name" content="ImageMagick" />
12  <meta name="description" content="Use ImageMagick® to create, edit, compose, and convert bitmap images. Resize an image, crop it, change its shades and colors, add captions, and more." />
13  <meta name="application-url" content="https://imagemagick.org" />
14  <meta name="generator" content="PHP" />
15  <meta name="keywords" content="magickcore, c, api:, convert, to, from, cipher, pixels, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert" />
16  <meta name="rating" content="GENERAL" />
17  <meta name="robots" content="INDEX, FOLLOW" />
18  <meta name="generator" content="ImageMagick Studio LLC" />
19  <meta name="author" content="ImageMagick Studio LLC" />
20  <meta name="revisit-after" content="2 DAYS" />
21  <meta name="resource-type" content="document" />
22  <meta name="copyright" content="Copyright (c) 1999-2020 ImageMagick Studio LLC" />
23  <meta name="distribution" content="Global" />
24  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
25  <meta property='og:url' content='../../' />
26  <meta property='og:title' content='ImageMagick' />
27  <meta property='og:image' content='../../images/logo.png' />
28  <meta property='og:type' content='website' />
29  <meta property='og:site_name' content='ImageMagick' />
30  <meta property='og:description' content="Convert, Edit, or Compose Bitmap Images" />
31  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
32  <link href="cipher.html" rel="canonical" />
33  <link href="../../images/wand.png" rel="icon" />
34  <link href="../../images/wand.ico" rel="shortcut icon" />
35  <link href="../assets/magick.css" rel="stylesheet" />
36</head>
37<body>
38  <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
39    <a class="navbar-brand" href="../../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../../images/wand.ico"/></a>
40    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation">
41      <span class="navbar-toggler-icon"></span>
42    </button>
43
44    <div class="navbar-collapse collapse" id="navbarsMagick" style="">
45    <ul class="navbar-nav mr-auto">
46      <li class="nav-item ">
47        <a class="nav-link" href="../../">Home <span class="sr-only">(current)</span></a>
48      </li>
49      <li class="nav-item ">
50        <a class="nav-link" href="../../www/download.html">Download</a>
51      </li>
52      <li class="nav-item ">
53        <a class="nav-link" href="../../www/command-line-tools.html">Tools</a>
54      </li>
55      <li class="nav-item ">
56        <a class="nav-link" href="../../www/command-line-processing.html">Command-line</a>
57      </li>
58      <li class="nav-item ">
59        <a class="nav-link" href="../../www/resources.html">Resources</a>
60      </li>
61      <li class="nav-item ">
62        <a class="nav-link" href="../../www/develop.html">Develop</a>
63      </li>
64      <li class="nav-item">
65        <a class="nav-link" target="_blank" href="https://imagemagick.org/discourse-server/">Community</a>
66      </li>
67    </ul>
68    <form class="form-inline my-2 my-lg-0" action="../https://imagemagick.org/script/search.php">
69      <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search">
70      <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button>
71    </form>
72    </div>
73  </nav>
74  <div class="container">
75   <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
76         style="display:block"
77         data-ad-client="ca-pub-3129977114552745"
78         data-ad-slot="6345125851"
79         data-full-width-responsive="true"
80         data-ad-format="horizontal"></ins>
81    <script>
82      (adsbygoogle = window.adsbygoogle || []).push({});
83    </script>
84
85  </div>
86
87  <main class="container">
88    <div class="magick-template">
89<div class="magick-header">
90<p class="text-center"><a href="cipher.html#AcquireAESInfo">AcquireAESInfo</a> &#8226; <a href="cipher.html#DestroyAESInfo">DestroyAESInfo</a> &#8226; <a href="cipher.html#EncipherAESBlock">EncipherAESBlock</a> &#8226; <a href="cipher.html#PasskeyDecipherImage">PasskeyDecipherImage</a> &#8226; <a href="cipher.html#PasskeyEncipherImage">PasskeyEncipherImage</a> &#8226; <a href="cipher.html#SetAESKey">SetAESKey</a> &#8226; <a href="cipher.html#PasskeyDecipherImage">PasskeyDecipherImage</a> &#8226; <a href="cipher.html#PasskeyEncipherImage">PasskeyEncipherImage</a></p>
91
92<h2><a href="../../api/MagickCore/cipher_8c.html" id="AcquireAESInfo">AcquireAESInfo</a></h2>
93
94<p>AcquireAESInfo() allocate the AESInfo structure.</p>
95
96<p>The format of the AcquireAESInfo method is:</p>
97
98<pre class="text">
99AESInfo *AcquireAESInfo(void)
100</pre>
101
102<h2><a href="../../api/MagickCore/cipher_8c.html" id="DestroyAESInfo">DestroyAESInfo</a></h2>
103
104<p>DestroyAESInfo() zeros memory associated with the AESInfo structure.</p>
105
106<p>The format of the DestroyAESInfo method is:</p>
107
108<pre class="text">
109AESInfo *DestroyAESInfo(AESInfo *aes_info)
110</pre>
111
112<p>A description of each parameter follows:</p>
113
114<dd>
115</dd>
116
117<dd> </dd>
118<dl class="dl-horizontal">
119<dt>aes_info</dt>
120<dd>the cipher context. </dd>
121
122<dd>  </dd>
123</dl>
124<h2><a href="../../api/MagickCore/cipher_8c.html" id="EncipherAESBlock">EncipherAESBlock</a></h2>
125
126<p>EncipherAESBlock() enciphers a single block of plaintext to produce a block of ciphertext.</p>
127
128<p>The format of the EncipherAESBlock method is:</p>
129
130<pre class="text">
131void EncipherAES(AESInfo *aes_info,const unsigned char *plaintext,
132  unsigned char *ciphertext)
133</pre>
134
135<p>A description of each parameter follows:</p>
136
137<dd>
138</dd>
139
140<dd> </dd>
141<dl class="dl-horizontal">
142<dt>aes_info</dt>
143<dd>the cipher context. </dd>
144
145<dd> </dd>
146<dt>plaintext</dt>
147<dd>the plain text. </dd>
148
149<dd> </dd>
150<dt>ciphertext</dt>
151<dd>the cipher text. </dd>
152
153<dd>  </dd>
154</dl>
155<h2><a href="../../api/MagickCore/cipher_8c.html" id="PasskeyDecipherImage">PasskeyDecipherImage</a></h2>
156
157<p>PasskeyDecipherImage() converts cipher pixels to plain pixels.</p>
158
159<p>The format of the PasskeyDecipherImage method is:</p>
160
161<pre class="text">
162MagickBooleanType PasskeyDecipherImage(Image *image,
163  const StringInfo *passkey,ExceptionInfo *exception)
164MagickBooleanType DecipherImage(Image *image,const char *passphrase,
165  ExceptionInfo *exception)
166</pre>
167
168<p>A description of each parameter follows:</p>
169
170<dd>
171</dd>
172
173<dd> </dd>
174<dl class="dl-horizontal">
175<dt>image</dt>
176<dd>the image. </dd>
177
178<dd> </dd>
179<dt>passphrase</dt>
180<dd>decipher cipher pixels with this passphrase. </dd>
181
182<dd> </dd>
183<dt>passkey</dt>
184<dd>decrypt cipher pixels with this passkey. </dd>
185
186<dd> </dd>
187<dt>exception</dt>
188<dd>return any errors or warnings in this structure. </dd>
189
190<dd>  </dd>
191</dl>
192<h2><a href="../../api/MagickCore/cipher_8c.html" id="PasskeyEncipherImage">PasskeyEncipherImage</a></h2>
193
194<p>PasskeyEncipherImage() converts pixels to cipher-pixels.</p>
195
196<p>The format of the PasskeyEncipherImage method is:</p>
197
198<pre class="text">
199MagickBooleanType PasskeyEncipherImage(Image *image,
200  const StringInfo *passkey,ExceptionInfo *exception)
201MagickBooleanType EncipherImage(Image *image,const char *passphrase,
202  ExceptionInfo *exception)
203</pre>
204
205<p>A description of each parameter follows:</p>
206
207<dd>
208</dd>
209
210<dd> </dd>
211<dl class="dl-horizontal">
212<dt>image</dt>
213<dd>the image. </dd>
214
215<dd> </dd>
216<dt>passphrase</dt>
217<dd>encipher pixels with this passphrase. </dd>
218
219<dd> </dd>
220<dt>passkey</dt>
221<dd>decrypt cipher pixels with this passkey. </dd>
222
223<dd> </dd>
224<dt>exception</dt>
225<dd>return any errors or warnings in this structure. </dd>
226
227<dd>  </dd>
228</dl>
229<h2><a href="../../api/MagickCore/cipher_8c.html" id="SetAESKey">SetAESKey</a></h2>
230
231<p>SetAESKey() sets the key for the AES cipher.  The key length is specified in bits.  Valid values are 128, 192, or 256 requiring a key buffer length in bytes of 16, 24, and 32 respectively.</p>
232
233<p>The format of the SetAESKey method is:</p>
234
235<pre class="text">
236SetAESKey(AESInfo *aes_info,const StringInfo *key)
237</pre>
238
239<p>A description of each parameter follows:</p>
240
241<dd>
242</dd>
243
244<dd> </dd>
245<dl class="dl-horizontal">
246<dt>aes_info</dt>
247<dd>the cipher context. </dd>
248
249<dd> </dd>
250<dt>key</dt>
251<dd>the key. </dd>
252
253<dd>  </dd>
254</dl>
255<h2><a href="../../api/MagickCore/cipher_8c.html" id="PasskeyDecipherImage">PasskeyDecipherImage</a></h2>
256
257<p>PasskeyDecipherImage() converts cipher pixels to plain pixels.</p>
258
259<p>The format of the PasskeyDecipherImage method is:</p>
260
261<pre class="text">
262MagickBooleanType PasskeyDecipherImage(Image *image,
263  const StringInfo *passkey,ExceptionInfo *exception)
264MagickBooleanType DecipherImage(Image *image,const char *passphrase,
265  ExceptionInfo *exception)
266</pre>
267
268<p>A description of each parameter follows:</p>
269
270<dd>
271</dd>
272
273<dd> </dd>
274<dl class="dl-horizontal">
275<dt>image</dt>
276<dd>the image. </dd>
277
278<dd> </dd>
279<dt>passphrase</dt>
280<dd>decipher cipher pixels with this passphrase. </dd>
281
282<dd> </dd>
283<dt>passkey</dt>
284<dd>decrypt cipher pixels with this passkey. </dd>
285
286<dd> </dd>
287<dt>exception</dt>
288<dd>return any errors or warnings in this structure. </dd>
289
290<dd>  </dd>
291</dl>
292<h2><a href="../../api/MagickCore/cipher_8c.html" id="PasskeyEncipherImage">PasskeyEncipherImage</a></h2>
293
294<p>PasskeyEncipherImage() converts pixels to cipher-pixels.</p>
295
296<p>The format of the PasskeyEncipherImage method is:</p>
297
298<pre class="text">
299MagickBooleanType PasskeyEncipherImage(Image *image,
300  const StringInfo *passkey,ExceptionInfo *exception)
301MagickBooleanType EncipherImage(Image *image,const char *passphrase,
302  ExceptionInfo *exception)
303</pre>
304
305<p>A description of each parameter follows:</p>
306
307<dd>
308</dd>
309
310<dd> </dd>
311<dl class="dl-horizontal">
312<dt>passphrase</dt>
313<dd>decipher cipher pixels with this passphrase. </dd>
314
315<dd> </dd>
316<dt>passkey</dt>
317<dd>decrypt cipher pixels with this passkey. </dd>
318
319<dd> </dd>
320<dt>exception</dt>
321<dd>return any errors or warnings in this structure. </dd>
322
323<dd>  </dd>
324</dl>
325</div>
326    </div>
327  </main><!-- /.container -->
328  <footer class="magick-footer">
329    <p><a href="../../www/security-policy.html">Security</a> •
330    <a href="../../www/architecture.html">Architecture</a>
331
332    <a href="cipher.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../../images/wand.ico"/></a>
333
334    <a href="../../www/links.html">Related</a> •
335     <a href="../../www/sitemap.html">Sitemap</a>
336    <br/>
337    <a href="../../www/support.html">Donate</a> •
338    <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
339    <a href="../../www/contact.html">Contact Us</a>
340    <br/>
341    <small>© 1999-2020 ImageMagick Studio LLC</small></p>
342  </footer>
343
344  <!-- Javascript assets -->
345  <script src="../assets/magick.js" crossorigin="anonymous"></script>
346  <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.4.1/jquery.min.js"><\/script>')</script>
347</body>
348</html>
349<!-- Magick Cache 4th January 2020 07:32 -->