100+ results for 'php crypt'

Not the results you expected?

mavlink_msg_change_operator_control.h (https://github.com/MacDev240/ArduPilotMega_OSD-with-Ublox-3D-DGPS.git) C Header · 204 lines

7 uint8_t target_system; ///< System the GCS requests control for

8 uint8_t control_request; ///< 0: request control of this MAV, 1: Release control of this MAV

9 uint8_t version; ///< 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.

10 char passkey[25]; ///< Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"

35 * @param target_system System the GCS requests control for

36 * @param control_request 0: request control of this MAV, 1: Release control of this MAV

37 * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.

38 * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"

70 * @param target_system System the GCS requests control for

71 * @param control_request 0: request control of this MAV, 1: Release control of this MAV

72 * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.

73 * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"

117 * @param target_system System the GCS requests control for

118 * @param control_request 0: request control of this MAV, 1: Release control of this MAV

119 * @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.

120 * @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"

extprofile_openssl.h (https://github.com/tmjnaid/hiphop-php.git) C Header · 227 lines

151 }

152

153 inline bool x_openssl_private_decrypt(CStrRef data, CVarRef decrypted, CVarRef key, int padding = k_OPENSSL_PKCS1_PADDING) {

154 FUNCTION_INJECTION_BUILTIN(openssl_private_decrypt);

164 FUNCTION_INJECTION_BUILTIN(openssl_public_decrypt);

165 return f_openssl_public_decrypt(data, decrypted, key, padding);

166 }

167

168 inline bool x_openssl_public_encrypt(CStrRef data, CVarRef crypted, CVarRef key, int padding = k_OPENSSL_PKCS1_PADDING) {

169 FUNCTION_INJECTION_BUILTIN(openssl_public_encrypt);

170 return f_openssl_public_encrypt(data, crypted, key, padding);

171 }

172

Rsa.php (https://github.com/tmccormi/openemr.git) PHP · 342 lines

11

12 use Traversable;

13 use Zend\Crypt\PublicKey\Rsa\Exception;

14 use Zend\Stdlib\ArrayUtils;

15

257

258 if (null === $key) {

259 throw new Exception\InvalidArgumentException('No key specified for the decryption');

260 }

261

262 if (null === $padding) {

263 $encrypted = $key->encrypt($data);

264 } else {

265 $encrypted = $key->encrypt($data, $padding);

test_cookie_only.py (https://gitlab.com/e0/beaker) Python · 277 lines

218 DIFFERENT_ENCRYPT_KEY = 'hello-world'

219

220 options = {'session.encrypt_key': COMMON_ENCRYPT_KEY,

221 'session.timeout': 300,

222 'session.validate_key': 'hoobermas',

230

231 # Check that we get the same session with the same cookie

232 options = {'session.encrypt_key': COMMON_ENCRYPT_KEY,

233 'session.timeout': 300,

234 'session.validate_key': 'hoobermas',

241 # change the encrypt_key so that it is unable to understand the cookie.

242 options = {'session.encrypt_key': DIFFERENT_ENCRYPT_KEY,

243 'session.timeout': 300,

244 'session.validate_key': 'hoobermas',

255 COMMON_ENCRYPT_KEY = '666a19cf7f61c64c'

256

257 options = {'session.encrypt_key': COMMON_ENCRYPT_KEY,

258 'session.timeout': 1,

259 'session.validate_key': 'hoobermas',

extprofile_openssl.h (https://github.com/diegoIta/hiphop-php.git) C Header · 227 lines

151 }

152

153 inline bool x_openssl_private_decrypt(CStrRef data, Variant decrypted, CVarRef key, int padding = k_OPENSSL_PKCS1_PADDING) {

154 FUNCTION_INJECTION_BUILTIN(openssl_private_decrypt);

164 FUNCTION_INJECTION_BUILTIN(openssl_public_decrypt);

165 return f_openssl_public_decrypt(data, ref(decrypted), key, padding);

166 }

167

168 inline bool x_openssl_public_encrypt(CStrRef data, Variant crypted, CVarRef key, int padding = k_OPENSSL_PKCS1_PADDING) {

169 FUNCTION_INJECTION_BUILTIN(openssl_public_encrypt);

170 return f_openssl_public_encrypt(data, ref(crypted), key, padding);

171 }

172

app.php (https://gitlab.com/fabiorf/edigital) PHP · 194 lines

1 <?php

2

3 return array(

35 |

36 | Here you may specify the default timezone for your application, which

37 | will be used by the PHP date and date-time functions. We have gone

38 | ahead and set this to a sensible default for you out of the box.

39 |

104 'Illuminate\Cookie\CookieServiceProvider',

105 'Illuminate\Database\DatabaseServiceProvider',

106 'Illuminate\Encryption\EncryptionServiceProvider',

107 'Illuminate\Filesystem\FilesystemServiceProvider',

108 'Illuminate\Hashing\HashServiceProvider',

160 'Controller' => 'Illuminate\Routing\Controller',

161 'Cookie' => 'Illuminate\Support\Facades\Cookie',

162 'Crypt' => 'Illuminate\Support\Facades\Crypt',

163 'DB' => 'Illuminate\Support\Facades\DB',

164 'Eloquent' => 'Illuminate\Database\Eloquent\Model',

app.php (https://gitlab.com/naufal/overtime-service-final) PHP · 210 lines

1 <?php

2

3 return [

48 |

49 | Here you may specify the default timezone for your application, which

50 | will be used by the PHP date and date-time functions. We have gone

51 | ahead and set this to a sensible default for you out of the box.

52 |

134 Illuminate\Cookie\CookieServiceProvider::class,

135 Illuminate\Database\DatabaseServiceProvider::class,

136 Illuminate\Encryption\EncryptionServiceProvider::class,

137 Illuminate\Filesystem\FilesystemServiceProvider::class,

138 Illuminate\Foundation\Providers\FoundationServiceProvider::class,

180 'Config' => Illuminate\Support\Facades\Config::class,

181 'Cookie' => Illuminate\Support\Facades\Cookie::class,

182 'Crypt' => Illuminate\Support\Facades\Crypt::class,

183 'DB' => Illuminate\Support\Facades\DB::class,

184 'Eloquent' => Illuminate\Database\Eloquent\Model::class,

md4.c (https://bitbucket.org/altlc/wive-rtnl-ralink-rt305x-routers-firmware-amod.git) C · 282 lines

23 #include "setup.h"

24

25 /* NSS crypto library does not provide the MD4 hash algorithm, so that we have

26 * a local implementation of it */

27 #ifdef USE_NSS

CacheManager.php (https://gitlab.com/dzakiafif/cokelatklasik) PHP · 311 lines

1 <?php

2

3 namespace Illuminate\Cache;

217 return $this->repository(

218 new DatabaseStore(

219 $connection, $this->app['encrypter'], $config['table'], $this->getPrefix($config)

220 )

221 );

mysql4-upgrade-1.5.9.9-1.6.0.0.php (https://bitbucket.org/acidel/buykoala.git) PHP · 306 lines

1 <?php

2 /**

3 * Magento

8 * that is bundled with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://opensource.org/licenses/osl-3.0.php

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

22 * @package Mage_Wishlist

23 * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)

24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

25 */

26

123 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,

124 'length' => 32,

125 'comment' => 'Sharing encrypted code'

126 ),

127 'updated_at' => array(

xtea.c (https://github.com/william0wang/ffmpeg-ww.git) C · 253 lines

220 if (decrypt) {

221 while (count--) {

222 crypt(ctx, dst, src, decrypt, iv);

223

224 src += 8;

244 uint8_t *iv, int decrypt)

245 {

246 xtea_crypt(ctx, dst, src, count, iv, decrypt, xtea_crypt_ecb);

247 }

248

250 uint8_t *iv, int decrypt)

251 {

252 xtea_crypt(ctx, dst, src, count, iv, decrypt, xtea_le_crypt_ecb);

253 }

254

CustomerController.php (https://gitlab.com/yamenpun/repair-tracking-system) PHP · 233 lines

1 <?php

2

3 namespace App\Http\Controllers\Admin;

121 'username' => $request->get('username'),

122 'email' => $request->get('email'),

123 'password' => bcrypt($request->get('password')),

124 'office_name' => $request->get('office_name'),

125 'mobile_number' => $request->get('mobile_number'),

177 'username' => $request->get('username'),

178 'email' => $request->get('email'),

179 'password' => bcrypt($request->get('password')),

180 'office_name' => $request->get('office_name'),

181 'mobile_number' => $request->get('mobile_number'),

Asset.php (https://gitlab.com/vietdhtn/myweb) PHP · 372 lines

17 * @category Microsoft

18 * @package WindowsAzure\MediaServices\Models

19 * @author Azure PHP SDK <azurephpsdk@microsoft.com>

20 * @copyright Microsoft Corporation

21 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0

70

71 /**

72 * The encryption options "storage encrypted"

73 *

74 * @var int

84

85 /**

86 * The encryption options "envelope encryption protected"

87 *

88 * @var int

20200805214300_SeparateThroughputTable.Designer.cs (https://github.com/microsoft/msquic.git) C# · 254 lines

142 .HasColumnType("int");

143

144 b.Property<bool>("Encryption")

145 .HasColumnType("bit");

146

cipherer.php (https://gitlab.com/Lidbary/PHPRunner) PHP · 297 lines

65 if($fetchedArray)

66 {

67 if( !$this->pSet->hasEncryptedFields() || !isEncryptionByPHPEnabled() )

68 return $fetchedArray;

69

255 public function EncryptField($field, $value)

256 {

257 if( $this->isFieldEncrypted($field) && isEncryptionByPHPEnabled() )

258 {

259 if( is_null($this->DESFunctions) )

276 public function DecryptField($field, $value)

277 {

278 if($this->isFieldEncrypted($field) && isEncryptionByPHPEnabled())

279 {

280 if(is_null($this->DESFunctions))

WindowsPhone81CompliancePolicy.php (https://github.com/microsoftgraph/msgraph-sdk-php.git) PHP · 350 lines

1 <?php

2 /**

3 * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.

4 *

5 * WindowsPhone81CompliancePolicy File

6 * PHP version 7

7 *

8 * @category Library

320

321 /**

322 * Gets the storageRequireEncryption

323 * Require encryption on windows phone devices.

324 *

325 * @return bool The storageRequireEncryption

326 */

327 public function getStorageRequireEncryption()

Windows81CompliancePolicy.php (https://github.com/microsoftgraph/msgraph-sdk-php.git) PHP · 350 lines

1 <?php

2 /**

3 * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.

4 *

5 * Windows81CompliancePolicy File

6 * PHP version 7

7 *

8 * @category Library

320

321 /**

322 * Gets the storageRequireEncryption

323 * Indicates whether or not to require encryption on a windows 8.1 device.

324 *

325 * @return bool The storageRequireEncryption

326 */

327 public function getStorageRequireEncryption()

socket.js (https://github.com/boyers/socket.js.git) JavaScript · 283 lines

1 'use strict';

2

3 var crypto = require('crypto');

4

5 // messages are converted to JSON before being sent down the wire

31 'Upgrade: websocket\r\n' +

32 'Connection: Upgrade\r\n' +

33 'Sec-WebSocket-Accept: ' + crypto.createHash('sha1').update(key + '258EAFA5-E914-47DA-95CA-C5AB0DC85B11').digest('base64') + '\r\n' +

34 '\r\n');

35

144 }

145

146 // read the masking key for decrypting the message, if there is one

147 var maskingKey;

148 if (mask) {

Target.php (https://github.com/sebastianfeldmann/phpbu.git) PHP · 460 lines

93 * File crypter.

94 *

95 * @var \phpbu\App\Backup\Crypter

96 */

97 private $crypter;

415 * @param \phpbu\App\Backup\Crypter $crypter

416 */

417 public function setCrypter(Crypter $crypter)

418 {

419 $this->crypter = $crypter;

426 * @return \phpbu\App\Backup\Crypter

427 */

428 public function getCrypter() : Crypter

429 {

430 return $this->crypter;

ring_signature_1.cpp (https://gitlab.com/nexxuz/cryptonote) C++ · 318 lines

1 // Copyright (c) 2011-2014 The Cryptonote developers

2 // Distributed under the MIT/X11 software license, see the accompanying

3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.

7

8 using namespace epee;

9 using namespace cryptonote;

10

11

69 }

70

71 bool gen_ring_signature_1::check_balances_1(cryptonote::core& c, size_t ev_index, const std::vector<test_event_entry>& events)

72 {

73 DEFINE_TESTS_ERROR_CONTEXT("gen_ring_signature_1::check_balances_1");

77

78 std::list<block> blocks;

79 bool r = c.get_blocks(0, 100 + 2 * CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, blocks);

80 CHECK_TEST_CONDITION(r);

81

ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersions.php (https://gitlab.com/efabian/maya) PHP · 222 lines

30 * GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose

31 * ASYMMETRIC_DECRYPT. (cryptoKeyVersions.asymmetricDecrypt)

32 *

33 * @param string $name Required. The resource name of the CryptoKeyVersion to

152 * Lists CryptoKeyVersions.

153 * (cryptoKeyVersions.listProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersions)

154 *

155 * @param string $parent Required. The resource name of the CryptoKey to list,

168 * earlier via ListCryptoKeyVersionsResponse.next_page_token.

169 * @opt_param int pageSize Optional. Optional limit on the number of

170 * CryptoKeyVersions to include in the response. Further CryptoKeyVersions can

171 * subsequently be obtained by including the

172 * ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. If

174 * @return Google_Service_CloudKMS_ListCryptoKeyVersionsResponse

175 */

176 public function listProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersions($parent, $optParams = array())

177 {

178 $params = array('parent' => $parent);

form_api.php (https://github.com/fusenigk/mantisbt-1.git) PHP · 207 lines

39 require_api( 'constant_inc.php' );

40 require_api( 'crypto_api.php' );

41 require_api( 'gpc_api.php' );

106 */

107 function form_security_param( $p_form_name ) {

108 if ( PHP_CLI == php_mode() || OFF == config_get_global( 'form_security_validation' ) ) {

109 return '';

110 }

128 */

129 function form_security_validate( $p_form_name ) {

130 if ( PHP_CLI == php_mode() || OFF == config_get_global( 'form_security_validation' ) ) {

131 return true;

132 }

170 */

171 function form_security_purge( $p_form_name ) {

172 if ( PHP_CLI == php_mode() || OFF == config_get_global( 'form_security_validation' ) ) {

173 return;

174 }

AbstractAopRequest.php (https://github.com/ecjia/ecjia-daojia.git) PHP · 548 lines

1 <?php

2

3 namespace Omnipay\Alipay\Requests;

14 protected $privateKey;

15

16 protected $encryptKey;

17

18 protected $alipayPublicKey;

427 * @return mixed

428 */

429 public function getEncryptKey()

430 {

431 return $this->encryptKey;

438 * @return $this

439 */

440 public function setEncryptKey($value)

441 {

442 $this->encryptKey = $value;

centreonAuth.SSO.class.php (https://gitlab.com/florianocomercial/centreon) PHP · 112 lines

1 <?php

2 /*

3 * Copyright 2005-2015 Centreon

34 */

35

36 include_once (_CENTREON_PATH_."/www/class/centreonAuth.class.php");

37

38 class CentreonAuthSSO extends CentreonAuth {

41 protected $sso_mandatory = 0;

42

43 public function __construct($username, $password, $autologin, $pearDB, $CentreonLog, $encryptType = 1, $token = "", $generalOptions) {

44 $this->options_sso = $generalOptions;

45 # var

61 }

62

63 parent::__construct($username, $password, $autologin, $pearDB, $CentreonLog, $encryptType, $token);

64

65 if ($this->error != '' && $this->sso_mandatory == 1) {

Bcmath.php (https://github.com/bruisedlee/zf2.git) PHP · 205 lines

1 <?php

2 /**

3 * Zend Framework

14 *

15 * @category Zend

16 * @package Zend_Crypt

17 * @subpackage Math

18 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

23 * @namespace

24 */

25 namespace Zend\Crypt\Math\BigInteger;

26

27 /**

28 * Support for arbitrary precision mathematics in PHP.

29 *

30 * Zend_Crypt_Math_BigInteger_Bcmath is a wrapper across the PHP BCMath

31 * extension.

32 *

encryption.php (https://gitlab.com/Red54/core) PHP · 368 lines

24

25 /**

26 * @var \OC\Encryption\Util | \PHPUnit_Framework_MockObject_MockObject

27 */

28 private $util;

34

35 /**

36 * @var \OCP\Encryption\IEncryptionModule | \PHPUnit_Framework_MockObject_MockObject

37 */

38 private $encryptionModule;

166 $this->encryptionModule = $this->getMockBuilder('\OCP\Encryption\IEncryptionModule')

167 ->disableOriginalConstructor()

168 ->setMethods(['getId', 'getDisplayName', 'begin', 'end', 'encrypt', 'decrypt', 'update', 'shouldEncrypt', 'getUnencryptedBlockSize', 'isReadable'])

169 ->getMock();

170

178 $this->encryptionModule->expects($this->any())->method('shouldEncrypt')->willReturn(true);

179 $this->encryptionModule->expects($this->any())->method('getUnencryptedBlockSize')->willReturn(8192);

180 $this->encryptionModule->expects($this->any())->method('isReadable')->willReturn(true);

EncryptionHelper.php (https://github.com/jarednipper/HSU-common-code.git) PHP · 271 lines

128 class TurningTechEncryptionHelper {

129

130 public $algorithm = MCRYPT_RIJNDAEL_128; // use MCRYPT_RIJNDAEL_128 for AES

131 public $algorithm_directory = '';

132 public $mode = MCRYPT_MODE_ECB;

193 */

194 protected function processData($direction, $str) {

195 if( $direction != self::ENCRYPT && $direction != self::DECRYPT ) throw new TurningTechEncryptionHelperException( 'Unknown encryption request ' . $direction );

196 $td = mcrypt_module_open( $this->algorithm, $this->algorithm_directory, $this->mode, $this->mode_directory );

201 $ivsize = mcrypt_enc_get_iv_size( $td );

202 if( $this->iv == '' ) $this->iv = mcrypt_create_iv( $ivsize ); // NOTE: must be the same value for encrypt/decrypt

203 if( $ivsize != strlen( $this->iv ) ) throw new TurningTechEncryptionHelperException( 'size of given IV ' . strlen( $this->iv ) . ' does not match required size ' . $ivsize );

218 if( ! mcrypt_generic_deinit( $td ) ) throw new TurningTechEncryptionHelperException( 'mcrypt_generic_deinit() returned FALSE' );

219 //if( mcrypt_module_close( $td ) ) throw new EncryptionHelperException( 'mcrypt_module_close() returned FALSE' );

220 mcrypt_module_close( $td ); // it returns false locally, for some unknown reason

pgp-pubenc.c (https://github.com/guocongwudi/9315ass2.git) C · 250 lines

1 /*

2 * pgp-pubenc.c

3 * Encrypt session key with public key.

4 *

5 * Copyright (c) 2005 Marko Kreen

27 * SUCH DAMAGE.

28 *

29 * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pubenc.c,v 1.5 2009/06/11 14:48:52 momjian Exp $

30 */

31 #include "postgres.h"

137

138 static int

139 encrypt_and_write_elgamal(PGP_Context *ctx, PGP_PubKey *pk, PushFilter *pkt)

140 {

141 int res;

Install.php (https://gitlab.com/axeltizon/magento-demopoweraccess) PHP · 173 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

23 * Install controller

24 *

25 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)

26 */

27 class Install extends AbstractActionController

110 $json->setVariable(

111 'key',

112 $this->installer->getInstallInfo()[SetupConfigOptionsList::KEY_ENCRYPTION_KEY]

113 );

114 $json->setVariable('success', true);

Bcmath.php (https://github.com/jtai/zf2.git) PHP · 205 lines

1 <?php

2 /**

3 * Zend Framework

14 *

15 * @category Zend

16 * @package Zend_Crypt

17 * @subpackage Math

18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)

23 * @namespace

24 */

25 namespace Zend\Crypt\Math\BigInteger;

26

27 /**

28 * Support for arbitrary precision mathematics in PHP.

29 *

30 * Zend_Crypt_Math_BigInteger_Bcmath is a wrapper across the PHP BCMath

31 * extension.

32 *

ContentPropertiesSerializerTest.php (git://github.com/WindowsAzure/azure-sdk-for-php.git) PHP · 313 lines

1 <?php

2 /**

3 * LICENSE: Licensed under the Apache License, Version 2.0 (the "License");

12 * limitations under the License.

13 *

14 * PHP version 5

15 *

16 * @category Microsoft

17 *

18 * @author Azure PHP SDK <azurephpsdk@microsoft.com>

19 * @copyright Microsoft Corporation

20 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0

38 * @category Microsoft

39 *

40 * @author Azure PHP SDK <azurephpsdk@microsoft.com>

41 * @copyright Microsoft Corporation

42 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0

bitcoin_ur_PK.ts (https://gitlab.com/Ltaimao/bitcoin) TypeScript · 342 lines

69 </message>

70 <message>

71 <source>Encrypt wallet</source>

72 <translation>بٹوے کی رمزنگاری</translation>

73 </message>

77 </message>

78 <message>

79 <source>Decrypt wallet</source>

80 <translation>خفیہ کشائی کر یںبٹوے کے</translation>

81 </message>

rsa-sign.js (https://github.com/lloyd/jwcrypto.git) JavaScript · 155 lines

8 //

9 // This software is licensed under the terms of the MIT License.

10 // http://www.opensource.org/licenses/mit-license.php

11 //

12 // The above copyright and license notice shall be

88 // ========================================================================

89

90 function _rsasign_getDecryptSignatureBI(biSig, hN, hE) {

91 var rsa = new RSAKey();

92 rsa.setPublic(hN, hE);

93 var biDecryptedSig = rsa.doPublic(biSig);

94 return biDecryptedSig;

96

97 function _rsasign_getHexDigestInfoFromSig(biSig, hN, hE) {

98 var biDecryptedSig = _rsasign_getDecryptSignatureBI(biSig, hN, hE);

99 var hDigestInfo = biDecryptedSig.toString(16).replace(/^1f+00/, '');

aes.php (https://github.com/dextercowley/joomla-cms.git) PHP · 239 lines

69 * Encrypts a string using AES

70 *

71 * @param string $stringToEncrypt The plaintext to encrypt

72 * @param bool $base64encoded Should I Base64-encode the result?

73 *

103 // Encrypt the data

104 $cipherText = mcrypt_encrypt($this->_cipherType, $key, $stringToEncrypt, $this->_cipherMode, $iv);

105

106 // Prepend the IV to the ciphertext

147 $iv = substr($stringToDecrypt, 0, $iv_size);

148 $stringToDecrypt = substr($stringToDecrypt, $iv_size);

149

150 // Decrypt the data

151 $plainText = mcrypt_decrypt($this->_cipherType, $key, $stringToDecrypt, $this->_cipherMode, $iv);

152

153 return $plainText;

cfb64ede.c (https://gitlab.com/envieidoc/tomato) C · 249 lines

1 /* crypto/des/cfb64ede.c */

2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)

4 *

5 * This package is an SSL implementation written

6 * by Eric Young (eay@cryptsoft.com).

7 * The implementation was written so as to conform with Netscapes SSL.

8 *

12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation

13 * included with this distribution is covered by the same copyright terms

14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).

15 *

16 * Copyright remains Eric Young's, and as such any Copyright notices in

31 * 3. All advertising materials mentioning features or use of this software

32 * must display the following acknowledgement:

33 * "This product includes cryptographic software written by

34 * Eric Young (eay@cryptsoft.com)"

Person.php (https://github.com/ewandor/horde.git) PHP · 164 lines

1 <?php

2 /**

3 * A person (objectclass 2.5.6.6).

4 *

5 * PHP version 5

6 *

7 * @category Kolab

9 * @author Gunnar Wrobel <wrobel@pardus.de>

10 * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1

11 * @link http://pear.horde.org/index.php?package=Kolab_Server

12 */

13

24 * @author Gunnar Wrobel <wrobel@pardus.de>

25 * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1

26 * @link http://pear.horde.org/index.php?package=Kolab_Server

27 */

28 class Horde_Kolab_Server_Object_Person extends Horde_Kolab_Server_Object_Top

siphash24.c (https://github.com/rustyrussell/ccan.git) C · 229 lines

3 * https://github.com/veorq/SipHash c03e6bbf6613243bc30788912ad4afbc0b992d47

4 */

5 #include <ccan/crypto/siphash24/siphash24.h>

6 #include <ccan/endian/endian.h>

7 #include <stdbool.h>

godeps_json_linker_spec.rb (https://gitlab.com/artofhuman/gitlab-ce) Ruby · 84 lines

45 },

46 {

47 "ImportPath": "golang.org/x/crypto/ssh/terminal",

48 "Rev": "1351f936d976c60a0a48d728281922cf63eafb8d"

49 },

QueueServiceProvider.php (https://gitlab.com/xolotsoft/pumasruiz) PHP · 305 lines

1 <?php namespace Illuminate\Queue;

2

3 use IlluminateQueueClosure;

239 $manager->addConnector('iron', function() use ($app)

240 {

241 return new IronConnector($app['encrypter'], $app['request']);

242 });

243

285 $this->app->bindShared('IlluminateQueueClosure', function($app)

286 {

287 return new IlluminateQueueClosure($app['encrypter']);

288 });

289 }

Change.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 204 lines

57 * @param \Magento\Framework\Filesystem $filesystem

58 * @param \Magento\Config\Model\Config\Structure $structure

59 * @param \Magento\Framework\Encryption\EncryptorInterface $encryptor

60 * @param \Magento\Framework\App\DeploymentConfig\Writer $writer

61 * @param string $connectionName

107 $encryptSegment = new ConfigData(ConfigFilePool::APP_ENV);

108 $encryptSegment->set(ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY, $this->encryptor->exportKeys());

109

110 $configData = [$encryptSegment->getFileKey() => $encryptSegment->getData()];

175 $this->getConnection()->update(

176 $table,

177 ['value' => $this->encryptor->encrypt($this->encryptor->decrypt($value))],

178 ['config_id = ?' => (int)$configId]

179 );

197 $this->getConnection()->update(

198 $table,

199 ['cc_number_enc' => $this->encryptor->encrypt($this->encryptor->decrypt($value))],

200 ['entity_id = ?' => (int)$valueId]

201 );

Makefile (https://github.com/voytech/DesktopCouchResource.git) Makefile · 287 lines

14 CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)

15 CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)

16 INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4 -I/usr/include/qjson -I/usr/include/QtCrypto -I.

17 LINK = g++

18 LFLAGS = -Wl,-O1 -shared -Wl,-soname,libcouchdb-qt.so.1

CssTest.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 148 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

10

11 /**

12 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)

13 */

14 class CssTest extends \PHPUnit_Framework_TestCase

20

21 /**

22 * @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject

23 */

24 protected $_objectManager;

25

26 /**

27 * @var \PHPUnit_Framework_MockObject_MockObject

28 */

29 protected $urlBuilder;

mpq.h (https://github.com/kizura/server.git) C Header · 98 lines

4 * Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>

5 *

6 * Some parts (the encryption and decryption stuff) were adapted from

7 * the C++ version of StormLib.h and StormPort.h included in stormlib.

8 * The C++ version belongs to the following authors:

54 #define LIBMPQ_ERROR_SIZE -9 /* buffer size is to small. */

55 #define LIBMPQ_ERROR_EXIST -10 /* file or block does not exist in archive. */

56 #define LIBMPQ_ERROR_DECRYPT -11 /* we don't know the decryption seed. */

57 #define LIBMPQ_ERROR_UNPACK -12 /* error on unpacking file. */

58

80 extern LIBMPQ_API int32_t libmpq__file_offset(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *offset);

81 extern LIBMPQ_API int32_t libmpq__file_blocks(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *blocks);

82 extern LIBMPQ_API int32_t libmpq__file_encrypted(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *encrypted);

83 extern LIBMPQ_API int32_t libmpq__file_compressed(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *compressed);

84 extern LIBMPQ_API int32_t libmpq__file_imploded(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *imploded);

Gmp.php (https://github.com/jacknicole/sugarcrm_dev.git) PHP · 196 lines

24 * @see Zend_Crypt_Math_BigInteger_Interface

25 */

26 require_once 'Zend/Crypt/Math/BigInteger/Interface.php';

27

28 /**

29 * Support for arbitrary precision mathematics in PHP.

30 *

31 * Zend_Crypt_Math_BigInteger_Bcmath is a wrapper across the PHP BCMath

32 * extension.

33 *

37 * @license http://framework.zend.com/license/new-bsd New BSD License

38 */

39 class Zend_Crypt_Math_BigInteger_Gmp implements Zend_Crypt_Math_BigInteger_Interface

40 {

41

obj_encdata.c (https://github.com/srajiv/trousers.git) C · 485 lines

81

82 TSS_RESULT

83 obj_encdata_get_policy(TSS_HENCDATA hEncData, UINT32 policyType, TSS_HPOLICY *phPolicy)

84 {

85 struct tsp_object *obj;

94 switch (policyType) {

95 case TSS_POLICY_USAGE:

96 *phPolicy = encdata->usagePolicy;

97 break;

98 default:

146 encdata = (struct tr_encdata_obj *)obj->data;

147

148 if (encdata->encryptedDataLength == 0) {

149 result = TSPERR(TSS_E_INVALID_OBJ_ACCESS);

150 goto done;

PathautoState.php (https://gitlab.com/mohamed_hussein/prodt) PHP · 186 lines

1 <?php

2

3 namespace Drupal\pathauto;

4

5 use Drupal\Component\Utility\Crypt;

6 use Drupal\Core\TypedData\TypedData;

7

181 return $entity_id;

182 }

183 return Crypt::hashBase64($entity_id);

184 }

185

Mail_2.php (https://gitlab.com/fiesta-framework/Documentation) PHP · 410 lines

1 <?php

2

3 /**

51 public static function send($view,$array,$callback)

52 {

53 //include "../core/Associates/PHPMailer/class.phpmailer.php";

54 include "../core/Associates/SwiftMailer/vendor/autoload.php";

73 $selfmail->host=Config::get("mail.host");

74 $selfmail->port=Config::get("mail.port");

75 $selfmail->secure=Config::get("mail.encryption");

76 $selfmail->type="html";

77 $selfmail->username=Config::get("mail.username");

196 // $mail->SMTPDebug=1;

197 // $mail->SMTPAuth=true;

198 // $mail->SMTPSecure=Config::get("mail.encryption");

199 // $mail->Host=Config::get("mail.host");

200 // $mail->Port=Config::get("mail.port");

application.php (https://bitbucket.org/Maron1/taqman.git) PHP · 199 lines

1 <?php

2

3 return array(

34 |--------------------------------------------------------------------------

35 |

36 | If you are including the "index.php" in your URLs, you can ignore this.

37 | However, if you are using mod_rewrite to get cleaner URLs, just set

38 | this option to an empty string and we'll take care of the rest.

40 */

41

42 'index' => 'index.php',

43

44 /*

164 'Controller' => 'Laravel\\Routing\\Controller',

165 'Cookie' => 'Laravel\\Cookie',

166 'Crypter' => 'Laravel\\Crypter',

167 'DB' => 'Laravel\\Database',

168 'Eloquent' => 'Laravel\\Database\\Eloquent\\Model',

Pkcs9MessageDigestTest.cs (https://github.com/iainlane/mono.git) C# · 84 lines

33 using System;

34 using System.Collections;

35 using System.Security.Cryptography;

36 using System.Security.Cryptography.Pkcs;

37

38 namespace MonoTests.System.Security.Cryptography.Pkcs {

39

40 [TestFixture]

Encrypt.php (https://github.com/joomla/joomla-cms.git) PHP · 128 lines

55

56 $this->aes->setPassword($this->getPassword(), false);

57 $encrypted = $this->aes->encryptString($data, true);

58

59 return '###AES128###' . $encrypted;

64 *

65 * @param string $data The ciphertext, prefixed by ###AES128###

66 * @param bool $legacy Use legacy key expansion? Use it to decrypt data encrypted with FOF 3.

67 *

68 * @return string The plaintext data

83

84 $this->aes->setPassword($this->getPassword(), $legacy);

85 $decrypted = $this->aes->decryptString($data, true, $legacy);

86

87 // Decrypted data is null byte padded. We have to remove the padding before proceeding.

Kolabpop3account.php (https://github.com/ewandor/horde.git) PHP · 195 lines

1 <?php

2 /**

3 * Represents external pop3 account information.

4 *

5 * PHP version 5

6 *

7 * @category Kolab

9 * @author Gunnar Wrobel <wrobel@pardus.de>

10 * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1

11 * @link http://pear.horde.org/index.php?package=Kolab_Server

12 */

13

24 * @author Gunnar Wrobel <wrobel@pardus.de>

25 * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1

26 * @link http://pear.horde.org/index.php?package=Kolab_Server

27 */

28 class Horde_Kolab_Server_Object_Kolabpop3account extends Horde_Kolab_Server_Object_Top

README.en.md (https://gitlab.com/Ltaimao/amazeui) Markdown · 93 lines

26 "nonceStr": "", // Signature random string.

27 "package": "", // The prepay_id returned by the unified order API

28 "signType": "", // Encryption method

29 "paySign": "" // Signature

30 },

55 ### Create order with WechatPay Unified Order API

56

57 See more details in [Official Docs](http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=9_1)

58

59 ### Generate Signature

60

61 See more details in [Wechat signature algorithm](http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=4_3)

62

63 ### Send pay request

class.t3lib_mail_mailer.php (https://github.com/itag/TYPO3v4-Core.git) PHP · 152 lines

1 <?php

2 /***************************************************************

3 * Copyright notice

27

28 // Make sure Swift's auto-loader is registered

29 require_once(PATH_typo3 . 'contrib/swiftmailer/swift_required.php');

30

31

74 * $TYPO3_CONF_VARS['MAIL']['transport_smtp_server'] = 'smtp.example.org';

75 * $TYPO3_CONF_VARS['MAIL']['transport_smtp_port'] = '25';

76 * $TYPO3_CONF_VARS['MAIL']['transport_smtp_encrypt'] = FALSE; # requires openssl in PHP

77 * $TYPO3_CONF_VARS['MAIL']['transport_smtp_username'] = 'username';

78 * $TYPO3_CONF_VARS['MAIL']['transport_smtp_password'] = 'password';

98 $port = '25';

99 }

100 $useEncryption = ($mailSettings['transport_smtp_encrypt'] ? $mailSettings['transport_smtp_encrypt'] : NULL);

101

102 // Create our transport

RijndKnownEnc1.cs (https://bitbucket.org/pmfsampaio/netmf-lpc.git) C# · 142 lines

1 //

2 // Rijndael Encrypting Comparison with known vectors in ECB mode.

3 //

4 using System;

5 using System.Security.Cryptography;

6 using System.IO;

7

36 Byte[] CipherCalculated;

37

38 Console.WriteLine("Encrypting the following bytes:");

39 PrintByteArray(Plain);

40 Console.WriteLine("With the following Key:");

55 ICryptoTransform sse = rjnd.CreateEncryptor(Key, IV);

56 MemoryStream ms = new MemoryStream();

57 CryptoStream cs = new CryptoStream(ms, sse, CryptoStreamMode.Write);

58 cs.Write(Plain,0,Plain.Length);

59 cs.FlushFinalBlock();

Default.php (https://github.com/BenBE/ispCP.git) PHP · 86 lines

23 class Auth {

24

25 function authenticate($data,$fckphp_config) {

26

27 //Hold relevant$fckphp_config vars locally

28 $key=$fckphp_config['auth']['Handler']['SharedKey'];

29 $fckphp_config['authSuccess']=false;

45

46 //Set the file root to the users individual one

47 $top=str_replace("//","/",$fckphp_config['basedir'].'/'.$fckphp_config['UserFilesPath']."/users");

48 $fckphp_config['UserFilesPath']=$fckphp_config['UserFilesPath']."/users/".$decArray[2];

49 $up=str_replace("//","/",$fckphp_config['basedir'].'/'.$fckphp_config['UserFilesPath']);

50

51 if (!file_exists($top)) {

TGBridgeContextService.m (https://gitlab.com/iranjith4/Telegram) Objective C · 96 lines

55 for (TGConversation *chat in next)

56 {

57 if (chat.isBroadcast || chat.isEncrypted)

58 continue;

59

CryptRand.c (https://gitlab.com/envieidoc/Clover) C · 110 lines

6 are licensed and made available under the terms and conditions of the BSD License

7 which accompanies this distribution. The full text of the license may be found at

8 http://opensource.org/licenses/bsd-license.php

9

10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,

13 **/

14

15 #include "InternalCryptLib.h"

16 #include <openssl/rand.h>

17 #include <openssl/evp.h>

18

19 //

20 // Default seed for UEFI Crypto Library

21 //

22 CONST UINT8 DefaultSeed[] = "UEFI Crypto Library default seed";

email.php (https://gitlab.com/Iftekhar_ramim/stock_management) PHP · 105 lines

1 <?php

2 require_once ('../../vendor/autoload.php');

52 * This example shows settings to use when sending via Google's Gmail servers.

53 */

54 //SMTP needs accurate times, and the PHP time zone MUST be set

55 //This should be done in your php.ini, but this is how to do it if you don't have access to that

56 date_default_timezone_set('Etc/UTC');

57 require ('../../vendor/phpmailer/phpmailer/class.phpmailer.php');

58 //Create a new PHPMailer instance

59 $mail = new PHPMailer;

60 //Tell PHPMailer to use SMTP

74 //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission

75 $mail->Port = 587;

76 //Set the encryption system to use - ssl (deprecated) or tls

77 $mail->SMTPSecure = 'tls';

78 //Whether to use SMTP authentication

Queue.php (https://gitlab.com/jjpa2018/dashboard) PHP · 398 lines

1 <?php

2

3 namespace Illuminate\Queue;

6 use DateTimeInterface;

7 use Illuminate\Container\Container;

8 use Illuminate\Contracts\Encryption\Encrypter;

9 use Illuminate\Contracts\Queue\ShouldBeEncrypted;

154 ]);

155

156 $command = $this->jobShouldBeEncrypted($job) && $this->container->bound(Encrypter::class)

157 ? $this->container[Encrypter::class]->encrypt(serialize(clone $job))

231 }

232

233 return isset($job->shouldBeEncrypted) && $job->shouldBeEncrypted;

234 }

235

config0.m4 (https://github.com/filp/php-src.git) m4 · 93 lines

15 if test -f "$phpincludedir/main/php_config.h"; then

16 ZTS=`grep '#define ZTS' $phpincludedir/main/php_config.h|$SED 's/#define ZTS//'`

17 if test "$ZTS" -eq "1"; then

18 enable_maintainer_zts="yes"

39 PHP_CHECK_LIBRARY(sqlite3, sqlite3_prepare_v2, [

40 AC_MSG_RESULT(found)

41 PHP_ADD_LIBRARY_WITH_PATH(sqlite3, $SQLITE3_DIR/$PHP_LIBDIR, SQLITE3_SHARED_LIBADD)

42 PHP_ADD_INCLUDE($SQLITE3_DIR/include)

76

77 dnl As long as intl is not shared we can have ICU support

78 if test "$PHP_INTL" = "yes" && test "$PHP_INTL_SHARED" != "yes"; then

79 other_flags="$other_flags -DSQLITE_ENABLE_ICU=1"

80 fi

88 sqlite3_sources="sqlite3.c $sqlite3_extra_sources"

89

90 PHP_NEW_EXTENSION(sqlite3, $sqlite3_sources, $ext_shared,,$PHP_SQLITE3_CFLAGS)

91 PHP_ADD_BUILD_DIR([$ext_builddir/libsqlite])

index.php (https://github.com/durand54/sitellite.git) PHP · 165 lines

1 <?php

2

3 loader_import ('saf.MailForm');

49 }

50

51 $this->parseSettings ('inc/conf/auth/preferences/index.php');

52

53 $prefs = ini_parse ('inc/conf/auth/preferences/index.php');

105 // update password

106 global $session;

107 $session->update (array ('password' => better_crypt ($vals['passwd'])));

108

109 // keep them logged in

152 if (! empty ($vals['orig'])) {

153 $current = db_shift ('select password from sitellite_user where username = ?', session_username ());

154 if (! better_crypt_compare ($vals['orig'], $current)) {

155 return false;

156 }

ext_openssl.php (https://github.com/tstarling/hiphop-php.git) PHP · 364 lines

1 <?php

2

3 function VS($x, $y) {

182 }

183

184 function test_openssl_private_encrypt() {

185 $privkey = openssl_pkey_new();

186 VERIFY($privkey != null);

191

192 $data = "some secret data";

193 VERIFY(openssl_private_encrypt($data, $out, $privkey));

194 VERIFY(openssl_public_decrypt($out, $out2, $pubkey));

196 }

197

198 function test_openssl_public_encrypt() {

199 $privkey = openssl_pkey_new();

200 VERIFY($privkey != null);

aes.php (https://github.com/CCI-Studios/Wee-Magazine.git) PHP · 167 lines

68 * @return string The cryptotext. Please note that the first 16 bytes of the raw string is the IV (initialisation vector) which is necessary for decoding the string.

69 */

70 public function encryptString($stringToEncrypt, $base64encoded = true)

71 {

72 // Calculate the key to use for encryption

90 // Encrypt the data

91 $cipherText = mcrypt_encrypt($this->_cipherType, $key, $stringToEncrypt, $this->_cipherMode, $iv);

92

93 // Prepend the IV to the ciphertext

133 // Decrypt the data

134 $plainText = mcrypt_decrypt($this->_cipherType, $key, $stringToDecrypt, $this->_cipherMode, $iv);

135

136 return $plainText;

138

139 /**

140 * Is AES encryption supported by this PHP installation?

141 *

142 * @return boolean

phone.php (https://github.com/mx504/Provisioner.git) PHP · 137 lines

1 <?php

2 /**

3 * HandyTone 286, 486 GXP Phone File

130 $final[$this->mac.".cfg"] = $this->parse_config_file($contents);

131

132 $final = $this->create_encrypted_file($final);

133

134 return($final);

RuntimeEnvironmentTest.cs (https://github.com/QuickJack/mono.git) C# · 86 lines

32 using System.Reflection;

33 using System.Runtime.InteropServices;

34 using System.Security.Cryptography;

35

36 using NUnit.Framework;

Bcrypt.php (https://bitbucket.org/zbahij/eprojets_app.git) PHP · 198 lines

15

16 /**

17 * Bcrypt algorithm using crypt() function of PHP

18 */

19 class Bcrypt implements PasswordInterface

66

67 /**

68 * Bcrypt

69 *

70 * @param string $password

83 * Check for security flaw in the bcrypt implementation used by crypt()

84 * @see http://php.net/security/crypt_blowfish.php

85 */

86 if ((version_compare(PHP_VERSION, '5.3.7') >= 0) && !$this->backwardCompatibility) {

91 if (preg_match('/[\x80-\xFF]/', $password)) {

92 throw new Exception\RuntimeException(

93 'The bcrypt implementation used by PHP can contains a security flaw ' .

94 'using password with 8-bit character. ' .

95 'We suggest to upgrade to PHP 5.3.7+ or use passwords with only 7-bit characters'

Ldap.php (https://github.com/finger2000/horde.git) PHP · 150 lines

1 <?php

2 /**

3 * The LDAP class attempts to change a user's password stored in an LDAP

6 * Copyright 2000-2011 Horde LLC (http://www.horde.org/)

7 *

8 * See http://www.horde.org/licenses/gpl.php for license information (GPL).

9 *

10 * @author Mike Cochrane <mike@graftonhall.co.nz>

53 array('host' => 'localhost',

54 'port' => 389,

55 'encryption' => 'crypt',

56 'show_encryption' => 'true',

136 // Change the user's password and update lastchange.

137 try {

138 $entry->replace(array($this->_params['attribute'] => $this->encryptPassword($new_password)), true);

139

140 if (!empty($this->_params['shadowlastchange']) &&

encryption.js (https://github.com/ciscospark/spark-js-sdk.git) JavaScript · 269 lines

35 it('fetches the conversation and does not alter its key', () => webex.internal.conversation.post({url: conversation.url}, {displayName: 'second'})

36 .then(() => webex.internal.conversation.get(conversation))

37 .then((c) => assert.equal(c.defaultActivityEncryptionKeyUrl, conversation.defaultActivityEncryptionKeyUrl)));

38 });

39

117 it('adds the specified user', () => webex.internal.conversation.add(conversation, mccoy)

118 .then(() => mccoy.webex.internal.conversation.get(conversation))

119 .then((c) => assert.property(c, 'defaultActivityEncryptionKeyUrl', 'The conversation was encrypted as a side effect of the add activity')));

120 });

121

131 .then((reason) => assert.instanceOf(reason, WebexHttpError.NotFound))

132 .then(() => webex.internal.conversation.get(conversation))

133 .then((c) => assert.notProperty(c, 'defaultActivityEncryptionKeyUrl', 'The conversation was not encrypted as a side effect of the leave activity')));

134 });

135

Link.php (https://gitlab.com/billyprice1/bdApi) PHP · 183 lines

1 <?php

2

3 /* @var $app XenForo_Application */

4 $app = XenForo_Application::getInstance();

5 $xenforoLinkPath = $app->getRootDir() . '/library/XenForo/Link.php';

6 $xenforoLinkContents = file_get_contents($xenforoLinkPath);

7

8 // remove <?php

9 $xenforoLinkContents = substr($xenforoLinkContents, 5);

10

49 $timestamp = time() + 86400;

50 $extraParams['_apiLanguageId'] = sprintf('%s %s', $timestamp,

51 bdApi_Crypt::encryptTypeOne($session->get('languageId'), $timestamp)

52 );

53 }

X509SignatureUtil.java (https://github.com/xl8or/-.git) Java · 123 lines

16 import myorg.bouncycastle.asn1.DERNull;

17 import myorg.bouncycastle.asn1.DERObjectIdentifier;

18 import myorg.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers;

19 import myorg.bouncycastle.asn1.nist.NISTObjectIdentifiers;

20 import myorg.bouncycastle.asn1.oiw.OIWObjectIdentifiers;

52 } else if(TeleTrusTObjectIdentifiers.ripemd256.equals(var0)) {

53 var1 = "RIPEMD256";

54 } else if(CryptoProObjectIdentifiers.gostR3411.equals(var0)) {

55 var1 = "GOST3411";

56 } else {

ModelFactory.php (https://gitlab.com/Ellomend/tasks) PHP · 189 lines

1 <?php

2

3 /*

19 'name' => $faker->name,

20 'email' => $faker->unique()->firstName.'@test.com',

21 'password' => $password ?: $password = bcrypt('secret'),

22 'remember_token' => str_random(10),

23 ];

crypt.class.php (https://github.com/massiveart-webservices/ZOOLU.git) PHP · 93 lines

56 public static function encrypt($core, $key, $plain_text)

57 {

58 $core->logger->debug('massiveart->utilities->Crypt->encrypt: ' . $key . ', ' . $plain_text);

59 try {

60 $plain_text = trim($plain_text);

61 $iv = substr(md5($key), 0, mcrypt_get_iv_size(MCRYPT_CAST_256, MCRYPT_MODE_CFB));

62 $c_t = mcrypt_cfb(MCRYPT_CAST_256, $key, $plain_text, MCRYPT_ENCRYPT, $iv);

63 return base64_encode($c_t);

64 } catch (Exception $exc) {

78 public static function decrypt($core, $key, $c_t)

79 {

80 $core->logger->debug('massiveart->utilities->Crypt->decrypt: ' . $key . ', ' . $c_t);

81 try {

82 $c_t = base64_decode($c_t);

83 $iv = substr(md5($key), 0, mcrypt_get_iv_size(MCRYPT_CAST_256, MCRYPT_MODE_CFB));

84 $p_t = mcrypt_cfb(MCRYPT_CAST_256, $key, $c_t, MCRYPT_DECRYPT, $iv);

85 return trim($p_t);

86 } catch (Exception $exc) {

aes_ct_enc.c (https://bitbucket.org/freebsd/freebsd-base.git) C · 112 lines

95 /* see inner.h */

96 void

97 br_aes_ct_bitslice_encrypt(unsigned num_rounds,

98 const uint32_t *skey, uint32_t *q)

99 {

firefox_tostring_console_injection.rb (https://github.com/jduck/metasploit-framework.git) Ruby · 103 lines

82 if (q) return;

83 q = true;

84 crypto.generateCRMFRequest("CN=Me", "#{Rex::Text.rand_text_alpha(5 + rand(12))}", "#{Rex::Text.rand_text_alpha(5 + rand(12))}", null, key, 1024, null, "rsa-ex");

85 return 5;

86 };

password.rb (https://gitlab.com/xenetics/services-website) Ruby · 87 lines

1 module BCrypt

2 # A password management class which allows you to safely store users' passwords and compare them.

3 #

4 # Example usage:

5 #

6 # include BCrypt

7 #

8 # # hash a user's password

9 # @password = Password.create("my grand secret")

10 # @password #=> "$2a$10$GtKs1Kbsig8ULHZzO1h2TetZfhO4Fmlxphp8bVKnUlZCBYYClPohG"

11 #

12 # # store it safely

44 cost = options[:cost] || BCrypt::Engine.cost

45 raise ArgumentError if cost > 31

46 Password.new(BCrypt::Engine.hash_secret(secret, BCrypt::Engine.generate_salt(cost)))

47 end

48

03.php (https://github.com/Sipcms/SipCMS.git) PHP · 50 lines

1 <?php defined('SYSPATH') or die('No direct script access.'); ?>

2

3 2011-09-03 18:43:23 --- ERROR: Kohana_Exception [ 0 ]: No encryption key is defined in the encryption configuration group: default ~ SYSPATH\classes\kohana\encrypt.php [ 68 ]

4 2011-09-03 18:43:23 --- ERROR: HTTP_Exception_404 [ 404 ]: Unable to find a route to match the URI: favicon.ico ~ SYSPATH\classes\kohana\request.php [ 1126 ]

22 #0 Z:\home\sipcms.local\www\index.php(109): Kohana_Request->execute()

23 #1 {main}

24 2011-09-03 18:44:56 --- ERROR: Kohana_Exception [ 0 ]: No encryption key is defined in the encryption configuration group: default ~ SYSPATH\classes\kohana\encrypt.php [ 68 ]

25 2011-09-03 19:07:07 --- ERROR: Kohana_Exception [ 0 ]: No encryption key is defined in the encryption configuration group: default ~ SYSPATH\classes\kohana\encrypt.php [ 68 ]

45 2011-09-03 19:11:18 --- ERROR: Kohana_Exception [ 0 ]: No encryption key is defined in the encryption configuration group: default ~ SYSPATH\classes\kohana\encrypt.php [ 68 ]

46 2011-09-03 19:12:14 --- ERROR: Kohana_Exception [ 0 ]: No encryption key is defined in the encryption configuration group: default ~ SYSPATH\classes\kohana\encrypt.php [ 68 ]

47 2011-09-03 19:12:44 --- ERROR: Kohana_Exception [ 0 ]: No encryption key is defined in the encryption configuration group: default ~ SYSPATH\classes\kohana\encrypt.php [ 68 ]

48 2011-09-03 19:15:50 --- ERROR: Kohana_Exception [ 0 ]: No encryption key is defined in the encryption configuration group: default ~ SYSPATH\classes\kohana\encrypt.php [ 68 ]

49 2011-09-03 19:22:09 --- ERROR: Kohana_Exception [ 0 ]: No encryption key is defined in the encryption configuration group: default ~ SYSPATH\classes\kohana\encrypt.php [ 68 ]

50 2011-09-03 19:30:00 --- ERROR: Kohana_Exception [ 0 ]: No encryption key is defined in the encryption configuration group: default ~ SYSPATH\classes\kohana\encrypt.php [ 68 ]

MockArraySessionStorage.php (https://gitlab.com/madwanz64/laravel) PHP · 252 lines

1 <?php

2

3 /*

17 * MockArraySessionStorage mocks the session for unit tests.

18 *

19 * No PHP session is actually started since a session can be initialized

20 * and shutdown only once per PHP execution cycle.

227 * Generates a session ID.

228 *

229 * This doesn't need to be particularly cryptographically secure since this is just

230 * a mock.

231 *

HashService.php (https://github.com/arbyte/FLOW3-X-TYPO3.FLOW3.git) PHP · 132 lines

1 <?php

2 namespace TYPO3\FLOW3\Security\Cryptography;

3

4 /* *

29 /**

30 * @FLOW3\Inject

31 * @var \TYPO3\FLOW3\Security\Cryptography\PasswordHashingStrategyInterface

32 */

33 protected $passwordHashingStrategy;

39 file_put_contents(FLOW3_PATH_DATA . 'Persistent/EncryptionKey', bin2hex(\TYPO3\FLOW3\Utility\Algorithms::generateRandomBytes(96)));

40 }

41 $this->encryptionKey = file_get_contents(FLOW3_PATH_DATA . 'Persistent/EncryptionKey');

42

43 if (empty($this->encryptionKey)) {

44 throw new \TYPO3\FLOW3\Security\Exception\MissingConfigurationException('No encryption key for the HashService was found and none could be created at "' . FLOW3_PATH_DATA . 'Persistent/EncryptionKey"', 1258991855);

45 }

46 }

Rm_user.php (https://gitlab.com/MichelZuniga/neoinvoice) PHP · 253 lines

1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

2 /**

3 * USER AUTHENTICATION DATABASE CLASS CodeIgniter Version by RENOWNED MEDIA

4 * @license http://www.opensource.org/licenses/bsd-license.php

5 * @author Thomas Hunter of Renowned Media

6 * @version 1.0.2

33 foreach($data AS $column => $value) {

34 if ($column == RM_PASSWORD_COLUMN) {

35 $value = $this->password_encrypt($value);

36 }

37 $sql .= "$column = " . $CI->db->escape($value) . ", ";

74 foreach($data AS $column => $value) {

75 if ($column == RM_PASSWORD_COLUMN) {

76 $value = $this->password_encrypt($value);

77 }

78 $sql .= "$column = " . $CI->db->escape($value) . ", ";

grid.php (https://github.com/scias23/OneRaimol.git) PHP · 101 lines

5 <?php if(isset($pageSelectionLabel)) : ?>

6 <p><?php echo $pageSelectionLabel ?></p>

7 <?php endif ?>

60 <?php $record_count = 0;?>

61 <?php foreach($materialstocklevel as $result) :?>

62 <?php $record_count++;?>

64 <?php if($accessflag) : ?>

65 <td><input class="id" name="id[]" type="checkbox" value ="<?php echo Helper_Helper::encrypt($result->stock_id); ?>" id="chk<?php echo $result->stock_id ?>"/></td>

66 <?php endif ?>

68 <td><?php echo $result->materialsupply->materials->description ?></td>

69 <td>PhP <?php echo number_format($result->materialsupply->price, 2) ?></td>

70 <td><?php echo $result->materialsupply->suppliers->company_name ?></td>

74 <td><a href="<?php echo $base_url ?>cms/inventory/stockusage/view/<?php echo Helper_Helper::encrypt($result->stock_id)?>">Sales</a></td>

75 <td><a href="<?php echo $base_url ?>cms/inventory/stock/edit/<?php echo Helper_Helper::encrypt($result->stock_id)?>">Edit</a></td>

76 </tr>

77

config.php (https://github.com/Doap/xoops.git) PHP · 94 lines

1 <?php

2 /**

3 * See the enclosed file license.txt for licensing information.

8 * @package installer

9 * @since 3.0

10 * @author Taiwen Jiang <phppp@users.sourceforge.net>

11 * @author Skalpa Keo <skalpa@xoops.org>

12 * @version $Id$

18 $configs['system'] = array(

19 'server' => '_INSTALL_REQUIREMENT_SERVER',

20 'php' => '_INSTALL_REQUIREMENT_PHP',

21 'persist' => '_INSTALL_REQUIREMENT_PERSIST',

22 'pdo' => '_INSTALL_REQUIREMENT_PDO',

34 //'xml' => '_INSTALL_EXTENSION_XML',

35 //'zlib' => '_INSTALL_EXTENSION_ZLIB',

36 //'mcrypt' => '_INSTALL_EXTENSION_MCRYPT',

37 //'fileinfo' => '_INSTALL_EXTENSION_FILEINFO',

38 //'json' => '_INSTALL_EXTENSION_JSON',

log-2015-09-04.php (https://gitlab.com/fcupen/PHP) PHP · 141 lines

29 INFO - 2015-09-04 13:57:55 --> File loaded: /usr/home/sow/domains/dev2.psychic-contact.com/public_html/application/views/header.php

30 INFO - 2015-09-04 13:57:55 --> File loaded: /usr/home/sow/domains/dev2.psychic-contact.com/public_html/application/views/error_page.php

31 INFO - 2015-09-04 13:57:55 --> File loaded: /usr/home/sow/domains/dev2.psychic-contact.com/public_html/application/views/footer.php

83 INFO - 2015-09-04 14:00:44 --> Language file loaded: language/english/pagination_lang.php

84 INFO - 2015-09-04 14:00:44 --> Pagination Class Initialized

85 INFO - 2015-09-04 14:00:44 --> Encrypt Class Initialized

86 DEBUG - 2015-09-04 14:00:44 --> Tb class already loaded. Second attempt ignored.

87 INFO - 2015-09-04 14:00:44 --> Model Class Initialized

89 INFO - 2015-09-04 14:00:44 --> Model Class Initialized

90 INFO - 2015-09-04 14:00:44 --> Controller Class Initialized

91 INFO - 2015-09-04 14:00:44 --> File loaded: /usr/home/sow/domains/dev2.psychic-contact.com/public_html/application/views/header.php

92 INFO - 2015-09-04 14:00:44 --> File loaded: /usr/home/sow/domains/dev2.psychic-contact.com/public_html/application/views/error_page.php

128 ERROR - 2015-09-04 14:26:04 --> Severity: Warning --> require_once(/usr/home/sow/domains/dev2.psychic-contact.com/public_html/application//controllers/popup.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory /usr/home/sow/domains/dev2.psychic-contact.com/public_html/application/controllers/chat/Main.php 3

129 ERROR - 2015-09-04 14:26:04 --> Severity: Compile Error --> require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/usr/home/sow/domains/dev2.psychic-contact.com/public_html/application//controllers/popup.php' (include_path='.:/usr/local/php5/lib/php') /usr/home/sow/domains/dev2.psychic-contact.com/public_html/application/controllers/chat/Main.php 3

130 ERROR - 2015-09-04 14:28:17 --> Could not find the language line "form_validation_xss_clean"

131 ERROR - 2015-09-04 14:28:17 --> Could not find the language line "form_validation_xss_clean"

DefaultPropertiesToSend.cs (https://github.com/gustavo-melo/mono.git) C# · 216 lines

79 }

80

81 [DefaultValue (EncryptionAlgorithm.Rc2)]

82 [MessagingDescription ("MsgEncryptionAlgorithm")]

83 public EncryptionAlgorithm EncryptionAlgorithm {

84 [MonoTODO]

85 get {throw new NotImplementedException();}

188

189 [DefaultValue (false)]

190 [MessagingDescription ("MsgUseEncryption")]

191 public bool UseEncryption {

Crypt.php (https://gitlab.com/LisovyiEvhenii/ismextensions) PHP · 170 lines

64 * @throws Magento_Exception

65 */

66 public function __construct($key, $cipher = MCRYPT_BLOWFISH, $mode = MCRYPT_MODE_ECB, $initVector = false)

67 {

68 $this->_cipher = $cipher;

74 throw new Magento_Exception('Key must not exceed ' . $maxKeySize . ' bytes.');

75 }

76 $initVectorSize = mcrypt_enc_get_iv_size($this->_handle);

77 if (true === $initVector) {

78 /* Generate a random vector from human-readable characters */

136

137 /**

138 * Encrypt a data

139 *

140 * @param string $data String to encrypt

164 * Returned string can in fact be longer than the unencrypted string due to the padding of the data

165 * @link http://www.php.net/manual/en/function.mdecrypt-generic.php

166 */

167 $data = rtrim($data, "\0");

Queue.php (https://gitlab.com/techniconline/kmc) PHP · 219 lines

7 use Illuminate\Container\Container;

8 use Illuminate\Contracts\Queue\QueueableEntity;

9 use Illuminate\Contracts\Encryption\Encrypter as EncrypterContract;

10

11 abstract class Queue

209 * Set the encrypter instance.

210 *

211 * @param \Illuminate\Contracts\Encryption\Encrypter $crypt

212 * @return void

213 */

214 public function setEncrypter(EncrypterContract $crypt)

215 {

216 $this->crypt = $crypt;

Decrypt.php (https://github.com/MontmereLimited/zf2.git) PHP · 105 lines

1 <?php

2 /**

3 * Zend Framework

27

28 /**

29 * Decrypts a given file and stores the decrypted file content

30 *

31 * @uses \Zend\Filter\Decrypt

36 * @license http://framework.zend.com/license/new-bsd New BSD License

37 */

38 class Decrypt extends Filter\Decrypt

39 {

40 /**

70 * Defined by Zend_Filter_Interface

71 *

72 * Decrypts the file $value with the defined settings

73 *

74 * @param string $value Full path of file to change

AttachedDiskInitializeParams.php (https://gitlab.com/Japang-Jawara/jawara-penilaian) PHP · 257 lines

61 */

62 public $sourceImage;

63 protected $sourceImageEncryptionKeyType = CustomerEncryptionKey::class;

64 protected $sourceImageEncryptionKeyDataType = '';

67 */

68 public $sourceSnapshot;

69 protected $sourceSnapshotEncryptionKeyType = CustomerEncryptionKey::class;

70 protected $sourceSnapshotEncryptionKeyDataType = '';

213 * @param CustomerEncryptionKey

214 */

215 public function setSourceImageEncryptionKey(CustomerEncryptionKey $sourceImageEncryptionKey)

216 {

217 $this->sourceImageEncryptionKey = $sourceImageEncryptionKey;

241 * @param CustomerEncryptionKey

242 */

243 public function setSourceSnapshotEncryptionKey(CustomerEncryptionKey $sourceSnapshotEncryptionKey)

244 {

245 $this->sourceSnapshotEncryptionKey = $sourceSnapshotEncryptionKey;

EncryptCookies.php (https://gitlab.com/jjpa2018/dashboard) PHP · 194 lines

6 use Illuminate\Contracts\Encryption\DecryptException;

7 use Illuminate\Contracts\Encryption\Encrypter as EncrypterContract;

8 use Illuminate\Cookie\CookieValuePrefix;

9 use Symfony\Component\HttpFoundation\Cookie;

37 * Create a new CookieGuard instance.

38 *

39 * @param \Illuminate\Contracts\Encryption\Encrypter $encrypter

40 * @return void

41 */

42 public function __construct(EncrypterContract $encrypter)

43 {

44 $this->encrypter = $encrypter;

45 }

46

123 foreach ($cookie as $key => $value) {

124 if (is_string($value)) {

125 $decrypted[$key] = $this->encrypter->decrypt($value, static::serialized($key));

126 }

127 }

0.1.0.php (https://github.com/azdcgo/axiscommerce.git) PHP · 64 lines

1 <?php

2 /**

3 * Axis

47 ->add('shipping/Usps_Standard/gateway', 'Gateway Url', 'http://production.shippingapis.com/ShippingAPI.dll')

48 ->add('shipping/Usps_Standard/service', 'Allowed Service', 'FIRST CLASS,PRIORITY,EXPRESS,BPM,PARCEL,MEDIA,LIBRARY', 'multiple', array('config_options' => '{"FIRST CLASS":"First-Class","PRIORITY":"Priority Mail","EXPRESS":"Express Mail","BPM":"Bound Printed Matter","PARCEL":"Parcel Post","MEDIA":"Media Mail","LIBRARY":"Library"}'))

49 ->add('shipping/Usps_Standard/userId', 'User ID', '', 'handler', '', array('model' => 'Crypt'))

50 ->add('shipping/Usps_Standard/container', 'Container', 'VARIABLE', 'select', '', array('config_options' => '{"VARIABLE":"Variable","FLAT RATE BOX":"Flat-Rate Box","FLAT RATE ENVELOPE":"Flat-Rate Envelope" ,"RECTANGULAR":"Rectangular","NONRECTANGULAR":"Non-rectangular"}'))

51 ->add('shipping/Usps_Standard/size', 'Size', 'REGULAR', 'select', '', array('config_options' => '{"REGULAR":"Regular","LARGE":"Large","OVERSIZE":"Oversize"}'))

DESTest.php (https://github.com/pbombo/warden.git) PHP · 92 lines

1 <?php

2

3 use CryptLib\Random\Mixer\DES;

4 use CryptLib\Core\Strength;

5 use CryptLibTest\Mocks\Cipher\Block\Cipher;

6 use CryptLibTest\Mocks\Cipher\Factory as CipherFactory;

7

8 class Unit_Random_Mixer_DESTest extends PHPUnit_Framework_TestCase {

36 $cipherkey = $key;

37 },

38 'encryptBlock' => function($data) use (&$cipherkey) {

39 return $data ^ $cipherkey;

40 },

SyncStorageRecordRequest.java (https://github.com/mozilla-services/android-sync.git) Java · 114 lines

11 import org.json.simple.JSONArray;

12 import org.json.simple.JSONObject;

13 import org.mozilla.gecko.sync.CryptoRecord;

14 import org.mozilla.gecko.sync.ThreadPool;

15

87 }

88

89 public void post(CryptoRecord record) {

90 this.post(record.toJSONObject());

91 }

92

93 public void put(CryptoRecord record) {

94 this.put(record.toJSONObject());

95 }

glue_helper.c (https://gitlab.com/maddy.kerneldev/my-linuxppc-next) C · 401 lines

27

28 #include <linux/module.h>

29 #include <crypto/b128ops.h>

30 #include <crypto/lrw.h>

31 #include <crypto/xts.h>

32 #include <asm/crypto/glue_helper.h>

140 struct blkcipher_walk *walk)

141 {

142 void *ctx = crypto_blkcipher_ctx(desc->tfm);

143 const unsigned int bsize = 128 / 8;

144 unsigned int nbytes = walk->nbytes;

368

369 while (nbytes) {

370 nbytes = __glue_xts_crypt_128bit(gctx, crypt_ctx, desc, &walk);

371

372 err = blkcipher_walk_done(desc, &walk, nbytes);

Authentication.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 168 lines

8 use Magento\Customer\Api\CustomerRepositoryInterface;

9 use Magento\Backend\App\ConfigInterface;

10 use Magento\Framework\Encryption\EncryptorInterface as Encryptor;

11 use Magento\Framework\Exception\InvalidEmailOrPasswordException;

12 use Magento\Framework\Exception\State\UserLockedException;

56 * @param ConfigInterface $backendConfig

57 * @param \Magento\Framework\Stdlib\DateTime $dateTime

58 * @param Encryptor $encryptor

59 */

60 public function __construct(

63 ConfigInterface $backendConfig,

64 \Magento\Framework\Stdlib\DateTime $dateTime,

65 Encryptor $encryptor

66 ) {

67 $this->customerRepository = $customerRepository;

TransportManager.php (https://gitlab.com/Sigpot/AirSpot) PHP · 186 lines

1 <?php

2

3 namespace Illuminate\Mail;

36 if (isset($config['encryption'])) {

37 $transport->setEncryption($config['encryption']);

38 }

39

ERXKeyStoreBlowfishCrypter.java (https://bitbucket.org/molequedeideias/wonder.git) Java · 164 lines

19 /**

20 * <p>

21 * ERXKeyStoreBlowfishCrypter is a blowfish implementation of the crypter

22 * interface that loads its secret key from a java keystore.

23 * </p>

44 * er.extensions.ERXCrypto.crypters=Blowfish

45 * er.extensions.ERXCrypto.crypter.Blowfish=er.extensions.ERXKeyStoreBlowfishCrypter

46 * </code>

47 *

58 * of the blowfish key in the keystore (if necessary)

59 */

60 public class ERXKeyStoreBlowfishCrypter extends ERXAbstractBlowfishCrypter {

61 private static final String KEYSTORE_TYPE = "JCEKS";

62 private static final String DEFAULT_KEY_ALIAS = "er.extensions.ERXBlowfishCipherKey";

97 // crypter.

98 String keyPasswordStr = ERXProperties.stringForKeyWithDefault("er.extensions.ERXKeyStoreBlowfishCrypter.keyPassword", ERXKeyStoreBlowfishCrypter.DEFAULT_KEY_PASSWORD);

99 char[] keyPassword = keyPasswordStr.toCharArray();

100

function.openssl-public-encrypt.html (https://bitbucket.org/thncr/manuals.git) HTML · 130 lines

15 <h1 class="refname">openssl_public_encrypt</h1>

16 <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5)</p><p class="refpurpose"><span class="refname">openssl_public_encrypt</span> &mdash; <span class="dc-title">Encrypts data with public key </span></p>

17

18 </div>

31 <span class="function"><strong>openssl_public_encrypt()</strong></span> encrypts <em><code class="parameter">data</code></em>

32 with public <em><code class="parameter">key</code></em> and stores the result into

33 <em><code class="parameter">crypted</code></em>. Encrypted data can be decrypted via

34 <span class="function"><a href="function.openssl-private-decrypt.html" class="function">openssl_private_decrypt()</a></span>.

118 <li class="member"> <span class="function"><a href="function.openssl-private-encrypt.html" class="function" rel="rdfs-seeAlso">openssl_private_encrypt()</a> - Encrypts data with private key</span></li>

119 <li class="member"> <span class="function"><a href="function.openssl-private-decrypt.html" class="function" rel="rdfs-seeAlso">openssl_private_decrypt()</a> - Decrypts data with private key</span></li>

120 </ul>

121 </p>

124

125 </div><hr /><div class="manualnavbar" style="text-align: center;">

126 <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-public-decrypt.html">openssl_public_decrypt</a></div>

127 <div class="next" style="text-align: right; float: right;"><a href="function.openssl-random-pseudo-bytes.html">openssl_random_pseudo_bytes</a></div>

128 <div class="up"><a href="ref.openssl.html">OpenSSL 函数</a></div>

group_multiple_test.php (https://github.com/F5/zetacomponents.git) PHP · 162 lines

1 <?php

2 /**

3 *

26 */

27

28 include_once( 'Authentication/tests/test.php' );

29

30 /**

41 public static function suite()

42 {

43 self::$data1 = array( // id_credentials, encrypted_token, token_method

44 array( 'qwerty', 'b1b3773a05c0ed0176787a4f1574ff0075f7521e', 'sha1' ),

45 array( 'wrong value', 'b1b3773a05c0ed0176787a4f1574ff0075f7521e', 'sha1' ),

46 );

47

48 self::$data2 = array( // id_credentials, encrypted_token, token_method

49 array( 'asdfgh', 'a152e841783914146e4bcd4f39100686', 'md5' ),

50 array( 'wrong value', 'a152e841783914146e4bcd4f39100686', 'md5' ),

SymmetricAlgorithm2Test.cs (https://github.com/iainlane/mono.git) C# · 173 lines

71

72 [Test]

73 [ExpectedException (typeof (CryptographicException))]

74 public void InvalidBlockSize ()

75 {

119

120 [Test]

121 [ExpectedException (typeof (CryptographicException))]

122 public void Key_WrongSize ()

123 {

163 des.Key = new byte [8] { 8, 7, 6, 5, 4, 3, 2, 1 };

164

165 ICryptoTransform enc = des.CreateEncryptor ();

166 byte[] response = new byte [16];

167 byte[] challenge = new byte [16] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };

CookieCryptTrait.php (https://gitlab.com/alexandresgv/siteentec) PHP · 171 lines

1 <?php

2 /**

3 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)

4 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)

5 *

9 *

10 * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)

11 * @link http://cakephp.org CakePHP(tm) Project

12 * @since 3.1.6

13 * @license http://www.opensource.org/licenses/mit-license.php MIT License

45 * @param string $value Value to encrypt

46 * @param string|bool $encrypt Encryption mode to use. False

47 * disabled encryption.

130 if ($encrypt === 'aes') {

131 $value = Security::decrypt($value, $this->_getCookieEncryptionKey());

132 }

133 return $this->_explode($value);

mpc837x_rdb_defconfig (http://omnia2droid.googlecode.com/svn/trunk/) Unknown · 1499 lines

431 # CONFIG_BLK_DEV_COW_COMMON is not set

432 CONFIG_BLK_DEV_LOOP=y

433 # CONFIG_BLK_DEV_CRYPTOLOOP is not set

434 # CONFIG_BLK_DEV_NBD is not set

435 # CONFIG_BLK_DEV_SX8 is not set

function.mcrypt-module-get-algo-key-size.html (https://github.com/vsilent/vim.git) HTML · 83 lines

6 </head>

7 <body><div style="text-align: center;">

8 <div class="prev" style="float: left;"><a href="function.mcrypt-module-get-algo-block-size.html">mcrypt_module_get_algo_block_size</a></div>

9 <div class="next" style="float: right;"><a href="function.mcrypt-module-get-supported-key-sizes.html">mcrypt_module_get_supported_key_sizes</a></div>

10 <div class="up"><a href="ref.mcrypt.html">mcrypt</a></div>

11 <div class="home"><a href="index.html">PHP Manual</a></div>

14 <h1 class="refname">mcrypt_module_get_algo_key_size</h1>

15 <p class="verinfo">(PHP 4 &gt;= 4.0.2, PHP 5)</p><p class="refpurpose dc-title">mcrypt_module_get_algo_key_size — Returns the maximum supported keysize of the opened mode</p>

16

17 </div>

77

78 </div><hr /><div style="text-align: center;">

79 <div class="prev" style="float: left;"><a href="function.mcrypt-module-get-algo-block-size.html">mcrypt_module_get_algo_block_size</a></div>

80 <div class="next" style="float: right;"><a href="function.mcrypt-module-get-supported-key-sizes.html">mcrypt_module_get_supported_key_sizes</a></div>

sys_options.php (https://github.com/korczis/Zeus.git) PHP · 108 lines

25 if($botnet_timeout < 1 || $botnet_timeout > 9999)$errors[] = LNG_SYS_E2;

26

27 if(!isset($_POST['botnet_cryptkey']))$botnet_cryptkey = $config['botnet_cryptkey'];

28 else

29 {

30 if(($l = strlen($_POST['botnet_cryptkey'])) < 1 || $l > 255)$errors[] = LNG_SYS_E3;

31 $botnet_cryptkey = $_POST['botnet_cryptkey'];

32 }

33

39 $updateList['reports_to_fs'] = $reports_to_fs ? 1 : 0;

40 $updateList['botnet_timeout'] = $botnet_timeout * 60;

41 $updateList['botnet_cryptkey'] = $botnet_cryptkey;

42

43 if(!updateConfig($updateList))$errors[] = LNG_SYS_E4;

96 str_replace('{TEXT}', LNG_SYS_BOTNET_CRYPTKEY, THEME_DIALOG_ITEM_TEXT).

97 str_replace(array('{NAME}', '{VALUE}', '{MAX}', '{WIDTH}'), array('botnet_cryptkey', htmlEntitiesEx($botnet_cryptkey), 255, INPUT_WIDTH), THEME_DIALOG_ITEM_INPUT_TEXT).

98 THEME_DIALOG_ROW_END.

99 THEME_DIALOG_GROUP_END.

mediauploader.php (https://gitlab.com/jalon/doadoronline) PHP · 88 lines

1 <?php

2 /**

3 * Media uploader class

54 protected static function getPostString($filepath, $url, $mediafile, $to, $from)

55 {

56 $host = parse_url($url, PHP_URL_HOST);

57

58 //filename to md5 digest

59 $cryptoname = md5($filepath) . "." . $mediafile['fileextension'];

60 $boundary = "zzXXzzYYzzXXzzQQ";

61

71 $hBAOS .= $from . "\r\n";

72 $hBAOS .= "--" . $boundary . "\r\n";

73 $hBAOS .= "Content-Disposition: form-data; name=\"file\"; filename=\"" . $cryptoname . "\"\r\n";

74 $hBAOS .= "Content-Type: " . $mediafile['filemimetype'] . "\r\n\r\n";

75

Math.php (https://github.com/Unplagged/unplagged.git) PHP · 102 lines

1 <?php

2 /**

3 * Zend Framework

14 *

15 * @category Zend

16 * @package Zend_Crypt

17 * @subpackage Math

18 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

24 * @see Zend_Crypt_Math_BigInteger

25 */

26 require_once 'Zend/Crypt/Math/BigInteger.php';

27

28 /**

32 * @license http://framework.zend.com/license/new-bsd New BSD License

33 */

34 class Zend_Crypt_Math extends Zend_Crypt_Math_BigInteger

35 {

36

jCrypt.class.php (https://github.com/foxmask/Booster.git) PHP · 143 lines

12

13 /**

14 * Static methods help to encrypt and decrypt string. mCrypt is used if it is

15 * installed, else a basic algorithm is used.

16 * @package jelix

33 if(function_exists("mcrypt_generic")&&mcrypt_module_self_test(MCRYPT_WAKE))

34 $decrypted=jCrypt::mcryptDecrypt($decodedString,$key);

35 else

36 $decrypted=jCrypt::simpleCrypt($decodedString,$key);

51 if(function_exists("mcrypt_generic")&&mcrypt_module_self_test(MCRYPT_WAKE))

52 $encrypted=jCrypt::mcryptEncrypt($string,$key);

53 else

54 $encrypted=jCrypt::simpleCrypt($string,$key);

88 if($key=='')

89 throw new jException('jelix~auth.error.key.empty');

90 $td = mcrypt_module_open(MCRYPT_WAKE, '', MCRYPT_MODE_STREAM, '');

91 $ks = mcrypt_enc_get_key_size($td);

Makefile (https://github.com/hrshygoodness/Luminary-Micro-Library.git) Makefile · 96 lines

74 ${COMPILER}/boot_eth.axf: ${COMPILER}/bl_can.o

75 ${COMPILER}/boot_eth.axf: ${COMPILER}/bl_check.o

76 ${COMPILER}/boot_eth.axf: ${COMPILER}/bl_decrypt.o

77 ${COMPILER}/boot_eth.axf: ${COMPILER}/bl_enet.o

78 ${COMPILER}/boot_eth.axf: ${COMPILER}/bl_flash.o

CheckboxField.php (https://gitlab.com/Lidbary/PHPRunner) PHP · 132 lines

1 <?php

2 class CheckboxField extends EditControl

3 {

55 return "";

56

57 $fullFieldName = $this->getFieldSQLDecrypt();

58 $bNeedQuotes = NeedQuotes($this->type);

59

PersistentTokenBasedRememberMeServices.php (https://github.com/Kiruban2011/symfony.git) PHP · 152 lines

1 <?php

2

3 namespace Symfony\Component\Security\Http\RememberMe;

130

131 /**

132 * Generates a cryptographically strong random value

133 *

134 * @return string

145

146 if (null !== $this->logger) {

147 $this->logger->warn('Could not produce a cryptographically strong random value. Please install/update the OpenSSL extension.');

148 }

149

hash.h (https://gitlab.com/Ltaimao/bitcoin) C Header · 164 lines

2 // Copyright (c) 2009-2013 The Bitcoin developers

3 // Distributed under the MIT software license, see the accompanying

4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.

5

6 #ifndef BITCOIN_HASH_H

7 #define BITCOIN_HASH_H

8

9 #include "crypto/ripemd160.h"

10 #include "crypto/sha256.h"

ChangePasswordLdapDriver.php (https://gitlab.com/wuhang2003/rainloop-webmail) PHP · 230 lines

1 <?php

2

3 class ChangePasswordLdapDriver implements \RainLoop\Providers\ChangePassword\ChangePasswordInterface

174 case 'crypt':

175 $sEncodedNewPassword = '{CRYPT}'.\crypt($sNewPassword, $this->getSalt(2));

176 break;

177 }

pgp-pubenc.c (https://gitlab.com/kush/jarulraj-postgresql-cpp) C · 249 lines

1 /*

2 * pgp-pubenc.c

3 * Encrypt session key with public key.

4 *

5 * Copyright (c) 2005 Marko Kreen

27 * SUCH DAMAGE.

28 *

29 * contrib/pgcrypto/pgp-pubenc.c

30 */

31 #include "postgres.h"

136

137 static int

138 encrypt_and_write_elgamal(PGP_Context *ctx, PGP_PubKey *pk, PushFilter *pkt)

139 {

140 int res;

InputSecurityParameters.java (https://bitbucket.org/__wp__/mb-linux-msli.git) Java · 334 lines

82

83 /**

84 * Decrypt a record, storing the decrypted fragment into the given array

85 * of byte buffers.

86 *

101 MacException, SSLException, ShortBufferException

102 {

103 return decrypt(record, output, offset, length, null);

104 }

105

106 /**

107 * Decrypt a record, storing the decrypted fragment into the given growable

108 * buffer.

109 *

cifsglob.h (http://omnia2droid.googlecode.com/svn/trunk/) C Header · 711 lines ✨ Summary

This C header file defines various global variables and data structures for a CIFS (Common Internet File System) implementation, which is a protocol used to access Windows networks from Linux systems. It sets up locks and counters for managing SMB sessions, transactions, and buffers, as well as debug counters and miscellaneous settings.

176 int timeAdj; /* Adjust for difference in server time zone in sec */

177 __u16 CurrentMid; /* multiplex id - rotating counter */

178 char cryptKey[CIFS_CRYPTO_KEY_SIZE];

179 /* 16th byte of RFC1001 workstation name is always null */

180 char workstation_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL];

298 bool retry:1;

299 bool nocase:1;

300 bool seal:1; /* transport encryption for this mounted share */

301 bool unix_ext:1; /* if false disable Linux extensions to CIFS protocol

302 for this mount even if server would support */

unzip.h (http://angel-engine.googlecode.com/svn/trunk/) C++ Header · 355 lines ✨ Summary

This is a C++ header file that provides an interface to read and write ZIP archives. It allows users to open, read, and close files within a ZIP archive, as well as access various metadata such as file names, sizes, and offsets. The library also supports password-protected files and compression methods.

8

9 Multi volume ZipFile (span) are not supported.

10 Encryption compatible with pkzip 2.04g only supported

11 Old compressions used by old PKZip 1.x are not supported

12

260 /*

261 Open for reading data the current file in the zipfile.

262 password is a crypting password

263 If there is no error, the return value is UNZ_OK.

264 */

loop.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 1674 lines ✨ Summary

This C code implements a Linux kernel module that provides a block device driver for creating virtual block devices, known as “loop devices”. It allows users to create and manage these devices, which can be used to emulate other block devices, such as CDs or hard drives. The module can be loaded at runtime, allowing users to dynamically add new loop devices without rebooting the system.

9 * DES encryption plus some minor changes by Werner Almesberger, 30-MAY-1993

10 * more DES encryption plus IDEA encryption by Nicholas J. Leon, June 20, 1996

11 *

12 * Modularized and updated for 1.1.16 kernel - Mitch Dsouza 28th May 1994

124 }

125

126 key = lo->lo_encrypt_key;

127 keysize = lo->lo_encrypt_key_size;

872 {

873 int err = 0;

874 struct loop_func_table *xfer = lo->lo_encryption;

875

876 if (xfer) {

900 module_put(owner);

901 else

902 lo->lo_encryption = xfer;

903 }

904 return err;

md2.h (http://opensource.apple.com/release/mac-os-x-1074/) C Header · 116 lines

23 <span class="enscript-comment">/* crypto/md/md2.h */</span>

24 <span class="enscript-comment">/* Copyright (C) 1995-1997 Eric Young (<a href="mailto:eay@cryptsoft.com">eay@cryptsoft.com</a>)

25 * All rights reserved.

26 *

27 * This package is an SSL implementation written

28 * by Eric Young (<a href="mailto:eay@cryptsoft.com">eay@cryptsoft.com</a>).

29 * The implementation was written so as to conform with Netscapes SSL.

30 *

34 * lhash, DES, etc., code; not just the SSL code. The SSL documentation

35 * included with this distribution is covered by the same copyright terms

36 * except that the holder is Tim Hudson (<a href="mailto:tjh@cryptsoft.com">tjh@cryptsoft.com</a>).

37 *

38 * Copyright remains Eric Young's, and as such any Copyright notices in

55 * &quot;This product includes cryptographic software written by

56 * Eric Young (<a href="mailto:eay@cryptsoft.com">eay@cryptsoft.com</a>)&quot;

57 * The word 'cryptographic' can be left out if the rouines from the library

org.gnome.Vino.gschema.xml (git://pkgs.fedoraproject.org/vino) XML · 175 lines

62 </key>

63

64 <key name='require-encryption' type='b'>

65 <summary>Require encryption</summary>

66 <description>

67 If true, remote users accessing the desktop are required to

68 support encryption. It is highly recommended that you use a

69 client which supports encryption unless the intervening network

WinZipAesException.cs (https://bitbucket.org/jens13/cleanzip.git) C# · 22 lines

2 // Distributed under the New BSD License.

3 // (See accompanying file notice.txt or at

4 // http://www.opensource.org/licenses/bsd-license.php)

5 // Source: https://bitbucket.org/jens13/cleanzip

6

12 {

13 public WinZipAesException()

14 : base("Error reading Aes excrypted zip file")

15 {

16 }