1.\" Copyright (c) 1999 Kungliga Tekniska H�gskolan 2.\" (Royal Institute of Technology, Stockholm, Sweden). 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 16.\" 3. Neither the name of the Institute nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" $Id: krb5_encrypt.3,v 1.7 2003/04/16 13:58:15 lha Exp $ 33.\" 34.Dd April 7, 1999 35.Dt KRB5_ENCRYPT 3 36.Os HEIMDAL 37.Sh NAME 38.Nm krb5_decrypt , 39.Nm krb5_decrypt_EncryptedData , 40.Nm krb5_encrypt , 41.Nm krb5_encrypt_EncryptedData 42.Nd encrypt and decrypt data 43.Sh LIBRARY 44Kerberos 5 Library (libkrb5, -lkrb5) 45.Sh SYNOPSIS 46.In krb5.h 47.Ft krb5_error_code 48.Fn krb5_encrypt "krb5_context context" "krb5_crypto crypto" "unsigned usage" "void *data" "size_t len" "krb5_data *result" 49.Ft krb5_error_code 50.Fn krb5_encrypt_EncryptedData "krb5_context context" "krb5_crypto crypto" "unsigned usage" "void *data" "size_t len" "int kvno" "EncryptedData *result" 51.Ft krb5_error_code 52.Fn krb5_decrypt "krb5_context context" "krb5_crypto crypto" "unsigned usage" "void *data" "size_t len" "krb5_data *result" 53.Ft krb5_error_code 54.Fn krb5_decrypt_EncryptedData "krb5_context context" "krb5_crypto crypto" "unsigned usage" "EncryptedData *e" "krb5_data *result" 55.Sh DESCRIPTION 56These functions are used to encrypt and decrypt data. 57.Pp 58.Fn krb5_encrypt 59puts the encrypted version of 60.Fa data 61(of size 62.Fa len ) 63in 64.Fa result . 65If the encryption type supports using derived keys, 66.Fa usage 67should be the appropriate key-usage. 68.Fn krb5_encrypt_EncryptedData 69does the same as 70.Fn krb5_encrypt , 71but it puts the encrypted data in a 72.Fa EncryptedData 73structure instead. If 74.Fa kvno 75is not zero, it will be put in the 76.Fa kvno field in the 77.Fa EncryptedData . 78.Pp 79.Fn krb5_decrypt , 80and 81.Fn krb5_decrypt_EncryptedData 82works similarly. 83.\" .Sh EXAMPLE 84.\" .Sh BUGS 85.Sh SEE ALSO 86.Xr krb5_create_checksum 3 , 87.Xr krb5_crypto_init 3 88