'. t('The encrypt module Provides an API for two-way encryption. Drupal has no native way to do two-way encryption. PHP\'s ability to do two-way encryption is a little more involved than most people care to get into. This module provides an easy way to encrypt() and decrypt().') .'

'; } return $output; } /** * Implementation of hook_theme(). */ function encrypt_theme($existing, $type, $theme, $path) { return array( 'encrypt_admin_list' => array( 'arguments' => array( 'methods' => array(), ), 'file' => 'includes/encrypt.theme.inc', ), ); } /** * Implementation of hook_perm(). */ function encrypt_perm() { return array('administer encrypt'); } /** * Implementation of hook_menu(). */ function encrypt_menu() { $items = array(); $items['admin/settings/encrypt'] = array( 'title' => 'Encrypt', 'description' => 'Main settings for encrypt.', 'page callback' => 'drupal_get_form', 'page arguments' => array('encrypt_admin_settings'), 'access arguments' => array('administer encrypt'), 'file' => 'includes/encrypt.admin.inc', 'type' => MENU_NORMAL_ITEM ); return $items; } /** * Initilize Encrypt * * Get necessary includes. */ function encrypt_initialize() { module_load_include('inc', 'encrypt', 'includes/encrypt.crypt'); // Include any files that modules want to include // TODO: Some sort of version checking foreach (module_implements('encrypt_api') as $module) { $info = module_invoke($module, 'encrypt_api'); if (is_array($info) && !empty($info['file'])) { require_once $info['file']; } } } /** * Encrypt * * Encrypt text. * * @param $text * Text to encrypt * @param $options * Array of options for encryption * @param $method * String name of method to use. Uses setting * default if NULL * @return * Encrypted text */ function encrypt($text = '', $options = array(), $method = NULL, $key_name = NULL) { encrypt_initialize(); return _encrypt_decrypt('encrypt', $text, $options, $method, $key_name); } /** * Decrypt * * Decrypt text. * * @param $text * Text to decrypt * @param $options * Array of options for decryption * @param $method * String name of method to use. Uses setting * default if NULL * @return * Decrypted text */ function decrypt($text = '', $options = array(), $method = NULL, $key_name = NULL) { encrypt_initialize(); return _encrypt_decrypt('decrypt', $text, $options, $method, $key_name); } /** * Implementation of hook_encrypt_api(). */ function encrypt_encrypt_api() { return array( 'file' => drupal_get_path('module', 'encrypt') . '/includes/encrypt.encrypt.inc', 'api version' => '1.0', ); }