PageRenderTime 5321ms queryTime 59ms sortTime 0ms getByIdsTime 368ms findMatchingLines 279ms

100+ results results for 'crypto.cip blowfish' (5321 ms)

Not the results you expected?
shiro.adoc https://github.com/gnodet/camel.git | AsciiDoc | 306 lines
                    
135
                    
136|`cipherService` |`AES` |org.apache.shiro.crypto.CipherService |Shiro ships with AES & Blowfish based CipherServices. You may use one
                    
137these or pass in your own Cipher implementation
                    
                
JCEStreamCipher.java https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk | Java | 532 lines
                    
9
                    
10import javax.crypto.Cipher;
                    
11import javax.crypto.CipherSpi;
                    
22import org.bouncycastle.crypto.BlockCipher;
                    
23import org.bouncycastle.crypto.CipherParameters;
                    
24import org.bouncycastle.crypto.DataLengthException;
                    
27// BEGIN android-removed
                    
28// import org.bouncycastle.crypto.engines.BlowfishEngine;
                    
29// import org.bouncycastle.crypto.engines.DESEngine;
                    
424    // /**
                    
425    //  * Blowfish
                    
426    //  */
                    
426    //  */
                    
427    // static public class Blowfish_CFB8
                    
428    //     extends JCEStreamCipher
                    
                
DESCoder.java https://gitlab.com/0072016/es | Java | 132 lines
                    
2
                    
3import javax.crypto.Cipher;
                    
4import javax.crypto.SecretKey;
                    
12 * <pre>
                    
13 * 支持 DES、DESede(TripleDES,就是3DES)、AES、Blowfish、RC2、RC4(ARCFOUR)
                    
14 * DES                  key size must be equal to 56
                    
16 * AES                  key size must be equal to 128, 192 or 256,but 192 and 256 bits may not be available
                    
17 * Blowfish             key size must be multiple of 8, and can only range from 32 to 448 (inclusive)
                    
18 * RC2                  key size must be between 40 and 1024 bits
                    
34     * AES                  key size must be equal to 128, 192 or 256,but 192 and 256 bits may not be available
                    
35     * Blowfish             key size must be multiple of 8, and can only range from 32 to 448 (inclusive)
                    
36     * RC2                  key size must be between 40 and 1024 bits
                    
                
AOSunJCECipher.java https://gitlab.com/edgardo001/clienteafirma | Java | 270 lines
                    
18import javax.crypto.BadPaddingException;
                    
19import javax.crypto.Cipher;
                    
20import javax.crypto.KeyGenerator;
                    
76        new AOCipherConfig(AOCipherAlgorithm.AES, AOCipherBlockMode.OFB, AOCipherPadding.ISO10126PADDING),
                    
77        new AOCipherConfig(AOCipherAlgorithm.BLOWFISH, AOCipherBlockMode.ECB, AOCipherPadding.PKCS5PADDING),
                    
78        new AOCipherConfig(AOCipherAlgorithm.BLOWFISH, AOCipherBlockMode.ECB, AOCipherPadding.ISO10126PADDING),
                    
78        new AOCipherConfig(AOCipherAlgorithm.BLOWFISH, AOCipherBlockMode.ECB, AOCipherPadding.ISO10126PADDING),
                    
79        new AOCipherConfig(AOCipherAlgorithm.BLOWFISH, AOCipherBlockMode.CBC, AOCipherPadding.PKCS5PADDING),
                    
80        new AOCipherConfig(AOCipherAlgorithm.BLOWFISH, AOCipherBlockMode.CBC, AOCipherPadding.ISO10126PADDING),
                    
80        new AOCipherConfig(AOCipherAlgorithm.BLOWFISH, AOCipherBlockMode.CBC, AOCipherPadding.ISO10126PADDING),
                    
81        new AOCipherConfig(AOCipherAlgorithm.BLOWFISH, AOCipherBlockMode.PCBC, AOCipherPadding.PKCS5PADDING),
                    
82        new AOCipherConfig(AOCipherAlgorithm.BLOWFISH, AOCipherBlockMode.PCBC, AOCipherPadding.ISO10126PADDING),
                    
82        new AOCipherConfig(AOCipherAlgorithm.BLOWFISH, AOCipherBlockMode.PCBC, AOCipherPadding.ISO10126PADDING),
                    
83        new AOCipherConfig(AOCipherAlgorithm.BLOWFISH, AOCipherBlockMode.CTR, AOCipherPadding.NOPADDING),
                    
84        new AOCipherConfig(AOCipherAlgorithm.BLOWFISH, AOCipherBlockMode.CTR, AOCipherPadding.PKCS5PADDING),
                    
                
_EKSBlowfish.py https://gitlab.com/abhi1tb/build | Python | 131 lines
                    
38_raw_blowfish_lib = load_pycryptodome_raw_lib(
                    
39        "Crypto.Cipher._raw_eksblowfish",
                    
40        """
                    
40        """
                    
41        int EKSBlowfish_start_operation(const uint8_t key[],
                    
42                                        size_t key_len,
                    
47                                        void **pResult);
                    
48        int EKSBlowfish_encrypt(const void *state,
                    
49                                const uint8_t *in,
                    
51                                size_t data_len);
                    
52        int EKSBlowfish_decrypt(const void *state,
                    
53                                const uint8_t *in,
                    
76
                    
77    start_operation = _raw_blowfish_lib.EKSBlowfish_start_operation
                    
78    stop_operation = _raw_blowfish_lib.EKSBlowfish_stop_operation
                    
                
StringEncrypter.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 312 lines
                    
7// CIPHER / GENERATORS
                    
8import javax.crypto.Cipher;
                    
9import javax.crypto.SecretKey;
                    
224            SecretKey desKey = KeyGenerator.getInstance( "DES" ).generateKey();
                    
225            SecretKey blowfishKey = KeyGenerator.getInstance( "Blowfish" ).generateKey();
                    
226            SecretKey desedeKey = KeyGenerator.getInstance( "DESede" ).generateKey();
                    
229            StringEncrypter desEncrypter = new StringEncrypter( desKey, desKey.getAlgorithm() );
                    
230            StringEncrypter blowfishEncrypter = new StringEncrypter( blowfishKey, blowfishKey.getAlgorithm() );
                    
231            StringEncrypter desedeEncrypter = new StringEncrypter( desedeKey, desedeKey.getAlgorithm() );
                    
234            String desEncrypted = desEncrypter.encrypt( secretString );
                    
235            String blowfishEncrypted = blowfishEncrypter.encrypt( secretString );
                    
236            String desedeEncrypted = desedeEncrypter.encrypt( secretString );
                    
239            String desDecrypted = desEncrypter.decrypt( desEncrypted );
                    
240            String blowfishDecrypted = blowfishEncrypter.decrypt( blowfishEncrypted );
                    
241            String desedeDecrypted = desedeEncrypter.decrypt( desedeEncrypted );
                    
                
DESCoder.java https://gitlab.com/BGCX262/zzsh-svn-to-git.git | Java | 165 lines
                    
9  
                    
10import javax.crypto.Cipher;  
                    
11import javax.crypto.KeyGenerator;  
                    
20 * <pre> 
                    
21 * 支持 DES、DESede(TripleDES,就是3DES)、AES、Blowfish、RC2、RC4(ARCFOUR) 
                    
22 * DES                  key size must be equal to 56 
                    
24 * AES                  key size must be equal to 128, 192 or 256,but 192 and 256 bits may not be available 
                    
25 * Blowfish             key size must be multiple of 8, and can only range from 32 to 448 (inclusive) 
                    
26 * RC2                  key size must be between 40 and 1024 bits 
                    
43     * AES                  key size must be equal to 128, 192 or 256,but 192 and 256 bits may not be available 
                    
44     * Blowfish             key size must be multiple of 8, and can only range from 32 to 448 (inclusive) 
                    
45     * RC2                  key size must be between 40 and 1024 bits 
                    
                
Blowfish.py https://gitlab.com/grayhamster/pycrypto | Python | 132 lines
                    
2#
                    
3#  Cipher/Blowfish.py : Blowfish
                    
4#
                    
33
                    
34    >>> from Crypto.Cipher import Blowfish
                    
35    >>> from Crypto import Random
                    
40    >>> iv = Random.new().read(bs)
                    
41    >>> cipher = Blowfish.new(key, Blowfish.MODE_CBC, iv)
                    
42    >>> plaintext = b'docendo discimus '
                    
47
                    
48.. _Blowfish: http://www.schneier.com/blowfish.html
                    
49
                    
55from Crypto.Cipher import blockalgo
                    
56from Crypto.Cipher import _Blowfish
                    
57
                    
                
test_Blowfish.py https://gitlab.com/abhi1tb/build | Python | 162 lines
                    
2#
                    
3#  SelfTest/Cipher/test_Blowfish.py: Self-test for the Blowfish cipher
                    
4#
                    
24
                    
25"""Self-test suite for Crypto.Cipher.Blowfish"""
                    
26
                    
30
                    
31from Crypto.Cipher import Blowfish
                    
32
                    
119
                    
120        cipher = Blowfish.new(b'4'*16, Blowfish.MODE_ECB)
                    
121
                    
152    from .common import make_block_tests
                    
153    tests = make_block_tests(Blowfish, "Blowfish", test_data)
                    
154    tests.append(KeyLength())
                    
                
Mcrypt.java https://github.com/moriyoshi/quercus-gae.git | Java | 343 lines
                    
38
                    
39import javax.crypto.Cipher;
                    
40import javax.crypto.spec.IvParameterSpec;
                    
189      return 24;
                    
190    else if (McryptModule.MCRYPT_BLOWFISH.equals(_algorithm))
                    
191      return 56;
                    
197  {
                    
198    if (McryptModule.MCRYPT_BLOWFISH.equals(_algorithm))
                    
199      return false;
                    
245  {
                    
246    if (_algorithm.equals(McryptModule.MCRYPT_BLOWFISH))
                    
247      return false;
                    
315      return "DESede/" + mode + "/NoPadding";
                    
316    else if (McryptModule.MCRYPT_BLOWFISH.equals(algorithm)) {
                    
317      // php/1q0t, #2561
                    
                
Blowfish.java https://gitlab.com/brian0218/rk3288_r-box_android4.4.2_sdk | Java | 77 lines
                    
2
                    
3import org.bouncycastle.crypto.CipherKeyGenerator;
                    
4import org.bouncycastle.crypto.engines.BlowfishEngine;
                    
11
                    
12public final class Blowfish
                    
13{
                    
13{
                    
14    private Blowfish()
                    
15    {
                    
22        {
                    
23            super(new BlowfishEngine());
                    
24        }
                    
31        {
                    
32            super(new CBCBlockCipher(new BlowfishEngine()), 64);
                    
33        }
                    
                
X509Token.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 203 lines
                    
15import javax.crypto.BadPaddingException;
                    
16import javax.crypto.Cipher;
                    
17import javax.crypto.IllegalBlockSizeException;
                    
42 * <li>cipher_type =
                    
43 * RSA(default)/AES/Blowfish/DES/DESede/PBEWithMD5AndDES/PBEWithHmacSHA1AndDESede/RC2/RC4/RC5 - see
                    
44 * http://java.sun.com/j2se/1.4.2/docs/guide/security/jce/JCERefGuide.html#AppA</li>
                    
                
__init__.py https://bitbucket.org/nicste/ballaxy.git | Python | 57 lines
                    
5
                    
6from Crypto.Cipher import Blowfish
                    
7from Crypto.Util.randpool import RandomPool
                    
35        self.id_secret = config['id_secret']
                    
36        self.id_cipher = Blowfish.new( self.id_secret )
                    
37    def encode_id( self, obj_id ):
                    
                
CRTSplitter.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 331 lines
                    
8   private long p[];
                    
9   private javax.crypto.Cipher c;
                    
10   private javax.crypto.SecretKey w;
                    
31	 c = 
                    
32	    javax.crypto.Cipher.getInstance(getAlgorithm() + "/ECB/NoPadding");
                    
33      }
                    
72   public static String getAlgorithm() {
                    
73      return "Blowfish";
                    
74   }
                    
116	 try {
                    
117	    c.init(javax.crypto.Cipher.ENCRYPT_MODE, w);
                    
118	 }
                    
130	    byte b[] = convert(rval[i]);
                    
131	    javax.crypto.CipherOutputStream cos = 
                    
132	       new javax.crypto.CipherOutputStream(bos, c);
                    
                
setup.py https://bitbucket.org/Behemot/university-rep.git | Python | 164 lines
                    
78            # Block encryption algorithms
                    
79            Extension("Crypto.Cipher.AES",
                    
80                      include_dirs=['src/'],
                    
81                      sources=["src/AES.c"]),
                    
82            Extension("Crypto.Cipher.ARC2",
                    
83                      include_dirs=['src/'],
                    
84                      sources=["src/ARC2.c"]),
                    
85            Extension("Crypto.Cipher.Blowfish",
                    
86                      include_dirs=['src/'],
                    
86                      include_dirs=['src/'],
                    
87                      sources=["src/Blowfish.c"]),
                    
88            Extension("Crypto.Cipher.CAST",
                    
90                      sources=["src/CAST.c"]),
                    
91            Extension("Crypto.Cipher.DES",
                    
92                      include_dirs=['src/'],
                    
                
BlowfishCBC.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 70 lines
                    
34
                    
35public class BlowfishCBC implements Cipher{
                    
36  private static final int ivsize=8;
                    
37  private static final int bsize=16;
                    
38  private javax.crypto.Cipher cipher;    
                    
39  public int getIVSize(){return ivsize;} 
                    
56      SecretKeySpec skeySpec = new SecretKeySpec(key, "Blowfish");
                    
57      cipher=javax.crypto.Cipher.getInstance("Blowfish/CBC/"+pad);
                    
58      cipher.init((mode==ENCRYPT_MODE?
                    
58      cipher.init((mode==ENCRYPT_MODE?
                    
59		   javax.crypto.Cipher.ENCRYPT_MODE:
                    
60		   javax.crypto.Cipher.DECRYPT_MODE),
                    
                
StringOBF.java https://gitlab.com/N00bVip/Noxious | Java | 88 lines
                    
7
                    
8import javax.crypto.Cipher;
                    
9import javax.crypto.spec.SecretKeySpec;
                    
16		SecretKeySpec sksSpec =
                    
17				new SecretKeySpec(key.getBytes(), "Blowfish");
                    
18
                    
18
                    
19		Cipher cipher = Cipher.getInstance("Blowfish");
                    
20		cipher.init(javax.crypto.Cipher.ENCRYPT_MODE, sksSpec);
                    
51		    SecretKeySpec sksSpec =
                    
52		        new SecretKeySpec(key.getBytes(), "Blowfish");
                    
53
                    
53
                    
54		    Cipher cipher = Cipher.getInstance("Blowfish");
                    
55		    cipher.init(Cipher.DECRYPT_MODE, sksSpec);
                    
                
CipherService.java http://cng1985.googlecode.com/svn/ | Java | 176 lines
                    
53 * is never shared with anyone.
                    
54 * <h2>{@code CipherService}s vs JDK {@link javax.crypto.Cipher Cipher}s</h2>
                    
55 * Shiro {@code CipherService}s essentially do the same things as JDK {@link javax.crypto.Cipher Cipher}s, but in
                    
72 * <li><b>Type Safe</b> - There are {@code CipherService} implementations for different Cipher algorithms
                    
73 * ({@code AesCipherService}, {@code BlowfishCipherService}, etc).  There is only one JDK {@code Cipher} class to
                    
74 * represent all cipher algorithms/instances.
                    
82 *
                    
83 * @see BlowfishCipherService
                    
84 * @see AesCipherService
                    
                
gnu.javax.crypto.cipher.java https://github.com/facebook/pfff.git | Java | 400 lines
                    
1package gnu.javax.crypto.cipher;
                    
2class WeakKeyException {
                    
350}
                    
351class Blowfish {
                    
352  class Block {
                    
                
CipherWithWrappingSpi.java https://gitlab.com/borneywpf/openjdk-7-src | Java | 261 lines
                    
38
                    
39import javax.crypto.Cipher;
                    
40import javax.crypto.CipherSpi;
                    
46/**
                    
47 * This class entends the javax.crypto.CipherSpi class with a concrete
                    
48 * implementation of the methods for wrapping and unwrapping
                    
53 *
                    
54 * @see javax.crypto.CipherSpi
                    
55 * @see BlowfishCipher
                    
                
test_Blowfish.py https://github.com/beenje/plugin.video.M6Replay.git | Python | 112 lines
                    
2#
                    
3#  SelfTest/Cipher/test_Blowfish.py: Self-test for the Blowfish cipher
                    
4#
                    
24
                    
25"""Self-test suite for Crypto.Cipher.Blowfish"""
                    
26
                    
102def get_tests(config={}):
                    
103    from Crypto.Cipher import Blowfish
                    
104    from common import make_block_tests
                    
104    from common import make_block_tests
                    
105    return make_block_tests(Blowfish, "Blowfish", test_data)
                    
106
                    
                
Blowfish.java https://gitlab.com/rizon/acid.git | Java | 294 lines
                    
3/**
                    
4 * Blowfish.java version 1.00.00
                    
5 *
                    
32import java.security.InvalidKeyException;
                    
33import javax.crypto.Cipher;
                    
34import javax.crypto.spec.SecretKeySpec;
                    
37
                    
38public class Blowfish
                    
39{
                    
39{
                    
40	private static final Logger log = LoggerFactory.getLogger(Blowfish.class);
                    
41
                    
42	/*
                    
43	 * Constructor of Blowfish class Key param
                    
44	 */
                    
                
TestOfBlowfish.java git://pkgs.fedoraproject.org/java-1.7.0-openjdk | Java | 148 lines
                    
1/* TestOfBlowfish.java -- 
                    
2   Copyright (C) 2006 Free Software Foundation, Inc.
                    
24
                    
25package gnu.testlet.gnu.javax.crypto.cipher;
                    
26
                    
27import gnu.java.security.util.Util;
                    
28import gnu.javax.crypto.cipher.Blowfish;
                    
29import gnu.javax.crypto.cipher.IBlockCipher;
                    
34/**
                    
35 * Conformance test for the Blowfish cipher.
                    
36 */
                    
36 */
                    
37public class TestOfBlowfish extends BaseCipherTestCase
                    
38{
                    
39  /**
                    
40   * Eric Young's Blowfish test vectors. See <a
                    
41   * href="http://www.counterpane.com/vectors.txt">http://www.counterpane.com/vectors.txt</a>.
                    
                
BlockCipherFactory.java https://gitlab.com/imxieke/remote-desktop-clients | Java | 115 lines
                    
1
                    
2package com.trilead.ssh2.crypto.cipher;
                    
3
                    
35
                    
36		ciphers.addElement(new CipherEntry("aes256-ctr", 16, 32, "com.trilead.ssh2.crypto.cipher.AES"));
                    
37		ciphers.addElement(new CipherEntry("aes192-ctr", 16, 24, "com.trilead.ssh2.crypto.cipher.AES"));
                    
38		ciphers.addElement(new CipherEntry("aes128-ctr", 16, 16, "com.trilead.ssh2.crypto.cipher.AES"));
                    
39		ciphers.addElement(new CipherEntry("blowfish-ctr", 8, 16, "com.trilead.ssh2.crypto.cipher.BlowFish"));
                    
40
                    
40
                    
41		ciphers.addElement(new CipherEntry("aes256-cbc", 16, 32, "com.trilead.ssh2.crypto.cipher.AES"));
                    
42		ciphers.addElement(new CipherEntry("aes192-cbc", 16, 24, "com.trilead.ssh2.crypto.cipher.AES"));
                    
43		ciphers.addElement(new CipherEntry("aes128-cbc", 16, 16, "com.trilead.ssh2.crypto.cipher.AES"));
                    
44		ciphers.addElement(new CipherEntry("blowfish-cbc", 8, 16, "com.trilead.ssh2.crypto.cipher.BlowFish"));
                    
45		
                    
                
TestOfBlowfish.java https://github.com/clibrepo/04f6ea02286af71632b72d73554979a61da424cf681886674b21ecd595715c12.git | Java | 180 lines
                    
1package gnu.testlet.gnu.crypto.cipher;
                    
2
                    
3// ----------------------------------------------------------------------------
                    
4// $Id: TestOfBlowfish.java,v 1.3 2003/09/27 00:04:20 raif Exp $
                    
5//
                    
48
                    
49import gnu.crypto.cipher.Blowfish;
                    
50import gnu.crypto.cipher.IBlockCipher;
                    
56/**
                    
57 * <p>Conformance test for the Blowfish cipher.</p>
                    
58 *
                    
60 */
                    
61public class TestOfBlowfish extends BaseCipherTestCase {
                    
62
                    
66   /**
                    
67    * Eric Young's Blowfish test vectors. See <a
                    
68    * href="http://www.counterpane.com/vectors.txt">http://www.counterpane.com/vectors.txt</a>.
                    
                
crypto.py https://code.google.com/p/wallproxy-plugins/ | Python | 130 lines
                    
33
                    
34    _BlockSize = {'AES':16, 'ARC2':8, 'ARC4':1, 'Blowfish':8, 'CAST':8,
                    
35                  'DES':8, 'DES3':8, 'IDEA':8, 'RC5':8, 'XOR':1}
                    
63        if self.cipher=='RC5' and self.keysize in (1, 57): self.keysize=32
                    
64        #try to import Crypto.Cipher.xxxx
                    
65        try:
                    
65        try:
                    
66            cipherlib = __import__('Crypto.Cipher.'+self.cipher, fromlist='x')
                    
67            self._newobj = cipherlib.new
                    
                
cryptocipher.py https://github.com/dahool/vertaal.git | Python | 69 lines
                    
20import base64
                    
21from Crypto.Cipher import Blowfish
                    
22from django.conf import settings
                    
27            pwd = getattr(settings, 'SECRET_KEY')
                    
28        self.__cipher = Blowfish.new(pwd)
                    
29    def encrypt(self, text):
                    
39        return cleartext
                    
40    # Blowfish cipher needs 8 byte blocks to work with
                    
41    def __pad_file(self, text):
                    
                
PEMUtilities.java https://gitlab.com/edgardo001/bc-java | Java | 272 lines
                    
13
                    
14import javax.crypto.Cipher;
                    
15import javax.crypto.SecretKey;
                    
149        {
                    
150            alg = "Blowfish";
                    
151            sKey = getKey(helper, password, alg, 16, iv);
                    
                
models.py https://github.com/goodguy/satchmo.git | Python | 127 lines
                    
5
                    
6from Crypto.Cipher import Blowfish
                    
7from datetime import datetime
                    
111    """Decrypt code encrypted by _encrypt_code"""
                    
112    # In some blowfish implementations, > 56 char keys can cause problems
                    
113    secret_key = settings.SECRET_KEY[:56]
                    
113    secret_key = settings.SECRET_KEY[:56]
                    
114    encryption_object = Blowfish.new(secret_key)
                    
115    # strip padding from decrypted credit card number
                    
119    """Quick encrypter for CC codes or code fragments"""
                    
120    # In some blowfish implementations, > 56 char keys can cause problems
                    
121    secret_key = settings.SECRET_KEY[:56]
                    
121    secret_key = settings.SECRET_KEY[:56]
                    
122    encryption_object = Blowfish.new(secret_key)
                    
123    # block cipher length must be a multiple of 8
                    
                
TestOfAssembly.java https://github.com/clibrepo/04f6ea02286af71632b72d73554979a61da424cf681886674b21ecd595715c12.git | Java | 198 lines
                    
54import gnu.crypto.assembly.TransformerException;
                    
55import gnu.crypto.cipher.Blowfish;
                    
56import gnu.crypto.cipher.IBlockCipher;
                    
97
                    
98      // build an OFB-Blowfish cascade
                    
99      Cascade ofbBlowfish = new Cascade();
                    
99      Cascade ofbBlowfish = new Cascade();
                    
100      Object modeNdx = ofbBlowfish.append(
                    
101            Stage.getInstance(
                    
101            Stage.getInstance(
                    
102                  ModeFactory.getInstance(Registry.OFB_MODE, new Blowfish(), 8),
                    
103                  Direction.FORWARD));
                    
109      testcase.asm = new Assembly();
                    
110      testcase.asm.addPreTransformer(Transformer.getCascadeTransformer(ofbBlowfish));
                    
111      testcase.asm.addPreTransformer(Transformer.getPaddingTransformer(pkcs7));
                    
                
Turkish.java https://github.com/srisatish/openjdk.git | Java | 49 lines
                    
32
                    
33import javax.crypto.Cipher;
                    
34
                    
42        System.out.println(Cipher.getInstance("rsa/ecb/pkcs1padding"));
                    
43        System.out.println(Cipher.getInstance("Blowfish"));
                    
44        System.out.println(Cipher.getInstance("blowfish"));
                    
44        System.out.println(Cipher.getInstance("blowfish"));
                    
45        System.out.println(Cipher.getInstance("BLOWFISH"));
                    
46
                    
                
Blowfish.py https://gitlab.com/abhi1tb/build | Python | 159 lines
                    
2#
                    
3#  Cipher/Blowfish.py : Blowfish
                    
4#
                    
41_raw_blowfish_lib = load_pycryptodome_raw_lib(
                    
42        "Crypto.Cipher._raw_blowfish",
                    
43        """
                    
43        """
                    
44        int Blowfish_start_operation(const uint8_t key[],
                    
45                                     size_t key_len,
                    
46                                     void **pResult);
                    
47        int Blowfish_encrypt(const void *state,
                    
48                             const uint8_t *in,
                    
73    start_operation = _raw_blowfish_lib.Blowfish_start_operation
                    
74    stop_operation = _raw_blowfish_lib.Blowfish_stop_operation
                    
75
                    
                
util.py https://bitbucket.org/nicste/ballaxy.git | Python | 32 lines
                    
2pkg_resources.require( "pycrypto" )
                    
3from Crypto.Cipher import Blowfish
                    
4
                    
14        user_hash = ( "!" * ( 8 - len( user_hash ) % 8 ) ) + user_hash
                    
15        cipher = Blowfish.new( str( dataset.create_time ) )
                    
16        user_hash = cipher.encrypt( user_hash ).encode( 'hex' )
                    
27    else:
                    
28        cipher = Blowfish.new( str( dataset.create_time ) )
                    
29        user_id = cipher.decrypt( user_hash.decode( 'hex' ) ).lstrip( "!" )
                    
                
BlowfishSerializer.java https://gitlab.com/kidaa/kryo.git | Java | 82 lines
                    
23
                    
24import javax.crypto.Cipher;
                    
25import javax.crypto.CipherInputStream;
                    
25import javax.crypto.CipherInputStream;
                    
26import javax.crypto.CipherOutputStream;
                    
27import javax.crypto.spec.SecretKeySpec;
                    
34
                    
35/** Encrypts data using the blowfish cipher.
                    
36 * @author Nathan Sweet <misc@n4te.com> */
                    
36 * @author Nathan Sweet <misc@n4te.com> */
                    
37public class BlowfishSerializer extends Serializer {
                    
38	private final Serializer serializer;
                    
40
                    
41	public BlowfishSerializer (Serializer serializer, byte[] key) {
                    
42		this.serializer = serializer;
                    
                
Poco.Crypto.CipherFactory.html git://pkgs.fedoraproject.org/poco | HTML | 75 lines
                    
25<div class="description">
                    
26<p>A factory for <a href="Poco.Crypto.Cipher.html" title="class Poco::Crypto::Cipher">Cipher</a> objects. See the <a href="Poco.Crypto.Cipher.html" title="class Poco::Crypto::Cipher">Cipher</a> class for examples on how to use the <a href="Poco.Crypto.CipherFactory.html" title="class Poco::Crypto::CipherFactory">CipherFactory</a>. </p>
                    
27</div>
                    
28<h2>Member Summary</h2>
                    
29<p><b>Member Functions: </b><a href="Poco.Crypto.CipherFactory.html#38" title="Poco::Crypto::CipherFactory::createCipher()">createCipher</a>, <a href="Poco.Crypto.CipherFactory.html#43" title="Poco::Crypto::CipherFactory::defaultFactory()">defaultFactory</a></p>
                    
30<h2>Constructors</h2>
                    
31<h3><a name="36">CipherFactory</a></h3>
                    
32<p class="decl"><a href="Poco.Crypto.CipherFactory.html" title="class Poco::Crypto::CipherFactory">CipherFactory</a>();</p>
                    
33<div class="description">
                    
43<h3><a name="38">createCipher</a></h3>
                    
44<p class="decl"><a href="Poco.Crypto.Cipher.html" title="class Poco::Crypto::Cipher">Cipher</a> * createCipher(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Crypto.CipherKey.html" title="class Poco::Crypto::CipherKey">CipherKey</a> &amp; key<br />);</p>
                    
45<div class="description">
                    
45<div class="description">
                    
46<p>Creates a <a href="Poco.Crypto.Cipher.html" title="class Poco::Crypto::Cipher">Cipher</a> object for the given <a href="Poco.Crypto.Cipher.html" title="class Poco::Crypto::Cipher">Cipher</a> name. Valid cipher  names depend on the OpenSSL version the library is linked with;   see the output of </p>
                    
47<p></p>
                    
                
Cipher.hs git://github.com/vincenthz/hs-cryptocipher.git | Haskell | 57 lines
                    
1-- |
                    
2-- Module      : Crypto.Cipher
                    
3-- License     : BSD-style
                    
12--
                    
13-- > import Crypto.Cipher
                    
14-- > import Data.ByteString (ByteString)
                    
23--
                    
24module Crypto.Cipher
                    
25    (
                    
45    , AES128, AES192, AES256
                    
46    , Blowfish, Blowfish64, Blowfish128, Blowfish256, Blowfish448
                    
47    , DES
                    
53import Crypto.Cipher.AES (AES128, AES192, AES256)
                    
54import Crypto.Cipher.Blowfish
                    
55import Crypto.Cipher.DES
                    
                
CipherFactory.java https://github.com/clibrepo/04f6ea02286af71632b72d73554979a61da424cf681886674b21ecd595715c12.git | Java | 150 lines
                    
1package gnu.crypto.cipher;
                    
2
                    
91         result = new Anubis();
                    
92      } else if (name.equalsIgnoreCase(BLOWFISH_CIPHER)) {
                    
93         result = new Blowfish();
                    
133      hs.add(ANUBIS_CIPHER);
                    
134      hs.add(BLOWFISH_CIPHER);
                    
135      hs.add(DES_CIPHER);
                    
                
KeyGen.java http://aionxemu.googlecode.com/svn/trunk/ | Java | 97 lines
                    
22
                    
23import javax.crypto.Cipher;
                    
24import javax.crypto.KeyGenerator;
                    
30/**
                    
31 * Key generator. It generates keys or keyPairs for Blowfish and RSA
                    
32 *
                    
41    /**
                    
42     * Key generator for blowfish
                    
43     */
                    
43     */
                    
44    private static KeyGenerator blowfishKeyGen;
                    
45
                    
58
                    
59        blowfishKeyGen = KeyGenerator.getInstance("Blowfish");
                    
60
                    
                
Cipher.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 805 lines
                    
103                }
                    
104                String[] other = {"AES128", "AES192", "AES256", "BLOWFISH", "RC2-40-CBC", "RC2-64-CBC", "RC4", "RC4-40", "CAST", "CAST-CBC"};
                    
105                String[] bases = {"AES-128", "AES-192", "AES-256", "BF", "DES", "DES-EDE", "DES-EDE3", "RC2", "CAST5"};
                    
162                cryptoVersion = "EDE3";
                    
163            } else if (cryptoBase.equals("Blowfish")) {
                    
164                cryptoBase = "BF";
                    
171
                    
172        public static String getAlgorithmBase(javax.crypto.Cipher cipher) {
                    
173            String algoBase = cipher.getAlgorithm();
                    
203            if ("bf".equalsIgnoreCase(cryptoBase)) {
                    
204                cryptoBase = "Blowfish";
                    
205            }
                    
273                    try {
                    
274                        if ((javax.crypto.Cipher.getMaxAllowedKeyLength(name) / 8) < keyLen) {
                    
275                            keyLen = javax.crypto.Cipher.getMaxAllowedKeyLength(name) / 8;
                    
                
BlowFish.java https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk | Java | 402 lines
                    
1package ch.ethz.ssh2.crypto.cipher;
                    
2
                    
29/**
                    
30 * A class that provides Blowfish key encryption operations, such as encoding
                    
31 * data and generating keys. All the algorithms herein are from Applied
                    
36 */
                    
37public class BlowFish implements BlockCipher
                    
38{
                    
                
BlowfishEngine.java https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk | Java | 576 lines
                    
3import org.bouncycastle.crypto.BlockCipher;
                    
4import org.bouncycastle.crypto.CipherParameters;
                    
5import org.bouncycastle.crypto.DataLengthException;
                    
8/**
                    
9 * A class that provides Blowfish key encryption operations,
                    
10 * such as encoding data and generating keys.
                    
13 */
                    
14public final class BlowfishEngine
                    
15implements BlockCipher
                    
                
EncryptedPrivateKeyInfoTest.java https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk | Java | 1232 lines
                    
39import javax.crypto.BadPaddingException;
                    
40import javax.crypto.Cipher;
                    
41import javax.crypto.EncryptedPrivateKeyInfo;
                    
90
                    
91            // Blowfish
                    
92            // NO OIDs for Blowfish defined (?)
                    
93            { "Blowfish", null },
                    
94            //            {"Blowfish","Blowfish/CBC/PKCS5Padding"},
                    
95            //            {"Blowfish","Blowfish/CFB/PKCS5Padding"},
                    
95            //            {"Blowfish","Blowfish/CFB/PKCS5Padding"},
                    
96            //            {"Blowfish","Blowfish/OFB/PKCS5Padding"},
                    
97            //            {"Blowfish","Blowfish/PCBC/PKCS5Padding"},
                    
                
JCEStreamCipher.java https://gitlab.com/brian0218/rk3188_rk3066_r-box_android4.4.2_sdk | Java | 623 lines
                    
17import javax.crypto.BadPaddingException;
                    
18import javax.crypto.Cipher;
                    
19import javax.crypto.CipherSpi;
                    
33import org.bouncycastle.crypto.BlockCipher;
                    
34import org.bouncycastle.crypto.CipherParameters;
                    
35import org.bouncycastle.crypto.DataLengthException;
                    
38// BEGIN android-removed
                    
39// import org.bouncycastle.crypto.engines.BlowfishEngine;
                    
40// import org.bouncycastle.crypto.engines.DESEngine;
                    
                
__init__.py https://bitbucket.org/chapmanb/galaxy-central/ | Python | 76 lines
                    
5
                    
6from Crypto.Cipher import Blowfish
                    
7from Crypto.Util.randpool import RandomPool
                    
37        self.id_secret = config['id_secret']
                    
38        self.id_cipher = Blowfish.new( self.id_secret )
                    
39
                    
                
__init__.py https://gitlab.com/grayhamster/pycrypto | Python | 83 lines
                    
41========================    =======   ========================
                    
42`Crypto.Cipher.AES`         Block     Advanced Encryption Standard
                    
43`Crypto.Cipher.ARC2`        Block     Alleged RC2
                    
44`Crypto.Cipher.ARC4`        Stream    Alleged RC4
                    
45`Crypto.Cipher.Blowfish`    Block     Blowfish
                    
46`Crypto.Cipher.CAST`        Block     CAST
                    
46`Crypto.Cipher.CAST`        Block     CAST
                    
47`Crypto.Cipher.DES`         Block     The Data Encryption Standard.
                    
48                                      Very commonly used in the past,
                    
49                                      but today its 56-bit keys are too small.
                    
50`Crypto.Cipher.DES3`        Block     Triple DES.
                    
51`Crypto.Cipher.XOR`         Stream    The simple XOR cipher.
                    
66==========================    =======================
                    
67`Crypto.Cipher.PKCS1_v1_5`    PKCS#1 v1.5 encryption, based on RSA key pairs
                    
68`Crypto.Cipher.PKCS1_OAEP`    PKCS#1 OAEP encryption, based on RSA key pairs
                    
                
BlowFish.java https://gitlab.com/imxieke/remote-desktop-clients | Java | 403 lines
                    
1
                    
2package com.trilead.ssh2.crypto.cipher;
                    
3
                    
30/**
                    
31 * A class that provides Blowfish key encryption operations, such as encoding
                    
32 * data and generating keys. All the algorithms herein are from Applied
                    
35 * @author See comments in the source file
                    
36 * @version $Id: BlowFish.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $
                    
37 */
                    
37 */
                    
38public class BlowFish implements BlockCipher
                    
39{
                    
                
transport.py https://gitlab.com/gupta.d.gaurav/paramiko | Python | 1251 lines
                    
66
                    
67from Crypto.Cipher import Blowfish, AES, DES3, ARC4
                    
68try:
                    
104        'aes128-cbc',
                    
105        'blowfish-cbc',
                    
106        'aes192-cbc',
                    
151        },
                    
152        'blowfish-cbc': {
                    
153            'class': Blowfish,
                    
153            'class': Blowfish,
                    
154            'mode': Blowfish.MODE_CBC,
                    
155            'block-size': 8,
                    
                
AbstractRememberMeManager.java https://github.com/apache/jsecurity.git | Java | 283 lines
                    
29import org.apache.ki.codec.Hex;
                    
30import org.apache.ki.crypto.BlowfishCipher;
                    
31import org.apache.ki.crypto.Cipher;
                    
40 * {@link #setSerializer(org.apache.ki.io.Serializer) serialization} and
                    
41 * {@link #setCipher(org.apache.ki.crypto.Cipher) encryption} of the remembered user identity.
                    
42 * <p/>
                    
58    private Serializer serializer = new DefaultSerializer();
                    
59    private Cipher cipher = new BlowfishCipher();
                    
60    private byte[] encryptionCipherKey = null;
                    
                
Tests.hs git://github.com/vincenthz/hs-cryptocipher.git | Haskell | 51 lines
                    
4import Test.Framework (defaultMain, testGroup)
                    
5import Crypto.Cipher.Blowfish
                    
6import Crypto.Cipher.Types
                    
6import Crypto.Cipher.Types
                    
7import Crypto.Cipher.Tests
                    
8import Data.ByteString.Char8 () -- orphan IsString for older bytestring versions
                    
49main = defaultMain
                    
50    [ testBlockCipher kats (undefined :: Blowfish64)
                    
51    ]
                    
                
models.py https://github.com/Ryati/satchmo.git | Python | 124 lines
                    
5
                    
6from Crypto.Cipher import Blowfish
                    
7from datetime import datetime
                    
111    secret_key = settings.SECRET_KEY
                    
112    encryption_object = Blowfish.new(secret_key)
                    
113    # strip padding from decrypted credit card number
                    
118    secret_key = settings.SECRET_KEY
                    
119    encryption_object = Blowfish.new(secret_key)
                    
120    # block cipher length must be a multiple of 8
                    
                
test.py https://bitbucket.org/geaden/halflife-notifications.git | Python | 453 lines
                    
18
                    
19from Crypto.Cipher import *
                    
20
                    
225
                    
226def TestBlockModules(args=['aes', 'arc2', 'des', 'blowfish', 'cast', 'des3',
                    
227                           'idea', 'rc5'],
                    
287    if 'blowfish' in args:
                    
288        ciph=exerciseBlockCipher('Blowfish',verbose)# Bruce Schneier's Blowfish cipher
                    
289        if (ciph!=None):
                    
290                if verbose: print '  Verifying against test suite...'
                    
291                for entry in testdata.blowfish:
                    
292                    key,plain,cipher=entry
                    
298                    if (ciphertext!=cipher):
                    
299                        die('Blowfish failed on entry '+`entry`)
                    
300                        for i in ciphertext:
                    
                
__init__.py https://github.com/dahool/vertaal.git | Python | 120 lines
                    
35        Cipher.__init__(self, key)
                    
36        self.__cipher = Blowfish(key)
                    
37    
                    
60
                    
61    # Blowfish cipher needs 8 byte blocks to work with
                    
62    def __pad_text(self, text):
                    
81        Cipher.__init__(self, key)
                    
82        self.__cipher = Blowfish.new(key)
                    
83        
                    
115try:        
                    
116    from Crypto.Cipher import Blowfish
                    
117    cipher = CryptoCipher
                    
118except:
                    
119    from blowfishcipher.blowfish import Blowfish
                    
120    cipher = LocalCipher
                    
                
transport.py https://github.com/jcrobak/hue.git | Python | 1362 lines
                    
22from Crypto import Util
                    
23from Crypto.Cipher import XOR
                    
24
                    
141                        'aes128-ctr', 'aes128-cbc', 'cast128-ctr',
                    
142                        'cast128-cbc', 'blowfish-ctr', 'blowfish-cbc',
                    
143                        '3des-ctr', '3des-cbc'] # ,'none']
                    
                
Blowfish.java https://github.com/penberg/classpath.git | Java | 611 lines
                    
1/* Blowfish.java --
                    
2   Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
                    
43
                    
44package gnu.javax.crypto.cipher;
                    
45
                    
53/**
                    
54 * Blowfish is a 16-round, 64-bit Feistel cipher designed by Bruce Schneier. It
                    
55 * accepts a variable-length key of up to 448 bits.
                    
60 * 647--654 (1996 Bruce Schneier).</li>
                    
61 * <li><a href="http://www.counterpane.com/blowfish.html">The Blowfish
                    
62 * Encryption Algorithm.</a></li>
                    
64 */
                    
65public class Blowfish
                    
66    extends BaseCipher
                    
                
test.py https://bitbucket.org/jasonrglasgow/gdata.git | Python | 453 lines
                    
18
                    
19from Crypto.Cipher import *
                    
20
                    
225
                    
226def TestBlockModules(args=['aes', 'arc2', 'des', 'blowfish', 'cast', 'des3',
                    
227                           'idea', 'rc5'],
                    
287    if 'blowfish' in args:
                    
288        ciph=exerciseBlockCipher('Blowfish',verbose)# Bruce Schneier's Blowfish cipher
                    
289        if (ciph!=None):
                    
290                if verbose: print('  Verifying against test suite...')
                    
291                for entry in testdata.blowfish:
                    
292                    key,plain,cipher=entry
                    
298                    if (ciphertext!=cipher):
                    
299                        die('Blowfish failed on entry '+repr(entry))
                    
300                        for i in ciphertext:
                    
                
X509Token.java https://github.com/jadahl/jgroups-android.git | Java | 245 lines
                    
5
                    
6import javax.crypto.Cipher;
                    
7import java.io.*;
                    
25 *  <li>auth_value (required) = the string to encrypt</li>
                    
26 *  <li>cipher_type = RSA(default)/AES/Blowfish/DES/DESede/PBEWithMD5AndDES/PBEWithHmacSHA1AndDESede/RC2/RC4/RC5 - see http://java.sun.com/j2se/1.4.2/docs/guide/security/jce/JCERefGuide.html#AppA</li>
                    
27 * </ul>
                    
                
__init__.py https://github.com/ambv/kitpy.git | Python | 59 lines
                    
36from Crypto.Cipher import AES as _AES
                    
37from Crypto.Cipher import Blowfish as _Blowfish
                    
38from Crypto.Cipher import CAST as _CAST
                    
38from Crypto.Cipher import CAST as _CAST
                    
39from Crypto.Cipher import DES as _DES
                    
40from Crypto.Cipher import DES3 as _DES3
                    
47    part.__name__ = name.lower()
                    
48    part.__module__ = b'lck.crypto.cipher'
                    
49    part.__doc__ = ("{}([key, path, create]) -> Cipher instance\n\nFactory "
                    
55aes = _setup_cipher(_AES)
                    
56blowfish = _setup_cipher(_Blowfish)
                    
57cast = _setup_cipher(_CAST)
                    
                
SecretKeyEncryptionStrategy.java https://gitlab.com/thugside/mule | Java | 124 lines
                    
16
                    
17import javax.crypto.Cipher;
                    
18import javax.crypto.KeyGenerator;
                    
25 * A keyFactory is an implementation of {@link SecretKeyFactory} and must return a
                    
26 * byte array. The default algorthm used by this strategy is Blowfish, but users can
                    
27 * specify any valid algorithm supported by JCE.
                    
37
                    
38    public static final String DEFAULT_ALGORITHM = "Blowfish";
                    
39
                    
                
Blowfish.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 107 lines
                    
28import javax.crypto.BadPaddingException;
                    
29import javax.crypto.Cipher;
                    
30import javax.crypto.IllegalBlockSizeException;
                    
35
                    
36public class Blowfish {
                    
37	private static final Logger LOG = Logger
                    
37	private static final Logger LOG = Logger
                    
38	.getLogger("org.columba.util.blowfish");
                    
39
                    
42	
                    
43	private static final Key KEY = new SecretKeySpec(BYTES, "Blowfish");
                    
44	
                    
47				// Create the cipher
                    
48				Cipher blowCipher = Cipher.getInstance("Blowfish");
                    
49
                    
                
PEMUtilities.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 185 lines
                    
6
                    
7import javax.crypto.Cipher;
                    
8import javax.crypto.SecretKey;
                    
70        {
                    
71            alg = "Blowfish";
                    
72            sKey = getKey(password, alg, 16, iv);
                    
                
ezPyCrypto.py https://bitbucket.org/Behemot/university-rep.git | Python | 1334 lines
                    
71from Crypto.Util.number import getPrime
                    
72from Crypto.Cipher import ARC2, Blowfish, CAST, DES3, IDEA, RC5
                    
73from Crypto.Hash import MD5
                    
133     - Data is encrypted with choice of symmetric block-mode session cipher
                    
134       (or default Blowfish if user doesn't care)
                    
135     - CFB block chaining is used for added security - each next block's
                    
169    
                    
170    _algosSes = { "ARC2":ARC2, "Blowfish":Blowfish, "CAST":CAST,
                    
171                  "DES3":DES3, "IDEA":IDEA, "RC5":RC5}
                    
173    
                    
174    _algosSes2 = [ARC2, Blowfish, CAST, DES3, IDEA, RC5]
                    
175    
                    
175    
                    
176    _algosSes3 = {ARC2:'ARC2', Blowfish:'Blowfish', CAST:'CAST',
                    
177                  DES3:'DES3', IDEA:'IDEA', RC5:'RC5'}
                    
                
TestJCEIntegration.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 171 lines
                    
31import java.security.SecureRandom;
                    
32import javax.crypto.Cipher;
                    
33import javax.crypto.KeyGenerator;
                    
105      System.out.println("Session key size = "+kbytes.length);
                    
106      SecretKeySpec clientKey = new SecretKeySpec(kbytes, "Blowfish");
                    
107      System.out.println("clientKey");
                    
108      
                    
109      Cipher cipher = Cipher.getInstance("Blowfish");
                    
110      cipher.init(Cipher.ENCRYPT_MODE, clientKey);
                    
114      byte[] skbytes = server.session.getSessionKey();
                    
115      SecretKeySpec serverKey = new SecretKeySpec(skbytes, "Blowfish");
                    
116      Cipher scipher = Cipher.getInstance("Blowfish");
                    
121      // Try a key that should fail
                    
122      KeyGenerator kgen = KeyGenerator.getInstance("Blowfish");
                    
123      kgen.init(320);
                    
                
GnuCrypto.java https://gitlab.com/lobl.pavel/gcc-6.2.0 | Java | 598 lines
                    
41import gnu.java.security.Registry;
                    
42import gnu.javax.crypto.cipher.CipherFactory;
                    
43import gnu.javax.crypto.mac.MacFactory;
                    
74        put("Cipher.ARCFOUR ImplementedIn", "Software");
                    
75        put("Cipher.BLOWFISH",
                    
76            gnu.javax.crypto.jce.cipher.BlowfishSpi.class.getName());
                    
76            gnu.javax.crypto.jce.cipher.BlowfishSpi.class.getName());
                    
77        put("Cipher.BLOWFISH ImplementedIn", "Software");
                    
78        put("Cipher.DES", gnu.javax.crypto.jce.cipher.DESSpi.class.getName());
                    
112            gnu.javax.crypto.jce.cipher.PBES2.HMacHaval.Anubis.class.getName());
                    
113        put("Cipher.PBEWithHMacHavalAndBlowfish",
                    
114            gnu.javax.crypto.jce.cipher.PBES2.HMacHaval.Blowfish.class.getName());
                    
133            gnu.javax.crypto.jce.cipher.PBES2.HMacMD2.Anubis.class.getName());
                    
134        put("Cipher.PBEWithHMacMD2AndBlowfish",
                    
135            gnu.javax.crypto.jce.cipher.PBES2.HMacMD2.Blowfish.class.getName());
                    
                
GnuCrypto.java https://github.com/clibrepo/04f6ea02286af71632b72d73554979a61da424cf681886674b21ecd595715c12.git | Java | 645 lines
                    
47import gnu.crypto.Registry;
                    
48import gnu.crypto.cipher.CipherFactory;
                    
49import gnu.crypto.hash.HashFactory;
                    
166               put("Cipher.ARCFOUR ImplementedIn", "Software");
                    
167               put("Cipher.BLOWFISH", "gnu.crypto.jce.cipher.BlowfishSpi");
                    
168               put("Cipher.BLOWFISH ImplementedIn", "Software");
                    
194                   "gnu.crypto.jce.cipher.PBES2$HMacHaval$Anubis");
                    
195               put("Cipher.PBEWithHMacHavalAndBlowfish",
                    
196                   "gnu.crypto.jce.cipher.PBES2$HMacHaval$Blowfish");
                    
215                   "gnu.crypto.jce.cipher.PBES2$HMacMD2$Anubis");
                    
216               put("Cipher.PBEWithHMacMD2AndBlowfish",
                    
217                   "gnu.crypto.jce.cipher.PBES2$HMacMD2$Blowfish");
                    
236                   "gnu.crypto.jce.cipher.PBES2$HMacMD4$Anubis");
                    
237               put("Cipher.PBEWithHMacMD4AndBlowfish",
                    
238                   "gnu.crypto.jce.cipher.PBES2$HMacMD4$Blowfish");
                    
                
Blowfish.java https://github.com/clibrepo/04f6ea02286af71632b72d73554979a61da424cf681886674b21ecd595715c12.git | Java | 584 lines
                    
1package gnu.crypto.cipher;
                    
2
                    
3// ----------------------------------------------------------------------------
                    
4// $Id: Blowfish.java,v 1.2 2002/11/07 17:17:44 raif Exp $
                    
5//
                    
56/**
                    
57 * Blowfish is a 16-round, 64-bit Feistel cipher designed by Bruce
                    
58 * Schneier. It accepts a variable-length key of up to 448 bits.
                    
63 *    336--339, 647--654 (1996 Bruce Schneier).</li>
                    
64 *    <li><a href="http://www.counterpane.com/blowfish.html">The
                    
65 *    Blowfish Encryption Algorithm.</a></li>
                    
67 */
                    
68public class Blowfish extends BaseCipher {
                    
69
                    
                
Blowfish.java https://github.com/clibrepo/04f6ea02286af71632b72d73554979a61da424cf681886674b21ecd595715c12.git | Java | 534 lines
                    
1package gnu.crypto.cipher;
                    
2
                    
3// ----------------------------------------------------------------------------
                    
4// $Id: Blowfish.java,v 1.1 2002/12/04 19:41:22 raif Exp $
                    
5//
                    
56/**
                    
57 * <p>Blowfish is a 16-round, 64-bit Feistel cipher designed by Bruce Schneier.
                    
58 * It accepts a variable-length key of up to 448 bits.</p>
                    
63 *    647--654 (1996 Bruce Schneier).</li>
                    
64 *    <li><a href="http://www.counterpane.com/blowfish.html">The Blowfish
                    
65 *     Encryption Algorithm.</a></li>
                    
67 */
                    
68public class Blowfish extends BaseCipher {
                    
69
                    
                
syncy.py https://gitlab.com/shinvdu/SyncY | Python | 928 lines
                    
36    from Crypto.Cipher import ARC4
                    
37    from Crypto.Cipher import Blowfish
                    
38    from Crypto.Cipher import AES
                    
39except ImportError, ex:
                    
40    ARC4 = Blowfish = AES = None
                    
41
                    
                
pct-speedtest.py https://gitlab.com/grayhamster/pycrypto | Python | 443 lines
                    
30from Crypto.PublicKey import RSA
                    
31from Crypto.Cipher import PKCS1_OAEP, PKCS1_v1_5 as RSAES_PKCS1_v1_5
                    
32from Crypto.Signature import PKCS1_PSS, PKCS1_v1_5 as RSASSA_PKCS1_v1_5
                    
32from Crypto.Signature import PKCS1_PSS, PKCS1_v1_5 as RSASSA_PKCS1_v1_5
                    
33from Crypto.Cipher import AES, ARC2, ARC4, Blowfish, CAST, DES3, DES, XOR
                    
34from Crypto.Hash import HMAC, MD2, MD4, MD5, SHA224, SHA256, SHA384, SHA512, CMAC
                    
323            ("AES256", AES, 32),
                    
324            ("Blowfish(256)", Blowfish, 32),
                    
325            ("CAST(40)", CAST, 5),
                    
366
                    
367        # Crypto.Cipher (block ciphers)
                    
368        for cipher_name, module, key_bytes in block_specs:
                    
                
models.py https://github.com/davemerwin/satchmo.git | Python | 82 lines
                    
5
                    
6from Crypto.Cipher import Blowfish
                    
7from django.conf import settings
                    
59        secret_key = settings.SECRET_KEY
                    
60        encryption_object = Blowfish.new(secret_key)
                    
61        # block cipher length must be a multiple of 8
                    
69        secret_key = settings.SECRET_KEY
                    
70        encryption_object = Blowfish.new(secret_key)
                    
71        # strip padding from decrypted credit card number
                    
                
tizmopidydeezer.py https://bitbucket.org/tizonia/tizonia-openmax-il | Python | 396 lines
                    
38
                    
39from Crypto.Cipher import AES, Blowfish
                    
40
                    
301        key_parts = map(lambda v: array('B', v), ('g4el58wc0zvf9na1', track_md5[:16], track_md5[16:]))
                    
302        blowfish_key = b''.join(chr(reduce(xor, x)) for x in zip(*key_parts))
                    
303        IV = pack('B' * 8, *range(8))
                    
305        def track_cipher():
                    
306            return Blowfish.new(blowfish_key, mode=Blowfish.MODE_CBC, IV=IV)
                    
307
                    
                
__init__.py https://bitbucket.org/galaxy/galaxy-central/ | Python | 131 lines
                    
7
                    
8from Crypto.Cipher import Blowfish
                    
9from Crypto.Util.randpool import RandomPool
                    
40        self.id_secret = config['id_secret']
                    
41        self.id_cipher = Blowfish.new( self.id_secret )
                    
42
                    
129    def __missing__( self, key ):
                    
130        return Blowfish.new( self.secret_base + "__" + key )
                    
131
                    
                
misc.py https://github.com/eviljoel/BARcamp-Chicago-Website.git | Python | 43 lines
                    
5
                    
6from Crypto.Cipher import Blowfish
                    
7from base64 import *
                    
12def cryptString( secret, plain ):
                    
13    obj = Blowfish.new( secret, Blowfish.MODE_ECB )
                    
14    #randstring = unicode(open("/dev/urandom").read(12), 'ascii', 'ignore')
                    
30def decryptString( secret, cipher ):
                    
31    obj = Blowfish.new( secret, Blowfish.MODE_ECB )
                    
32    try:
                    
                
CipherStreamTest2.java https://gitlab.com/edgardo001/bc-java | Java | 519 lines
                    
73        // cast required for earlier JDK
                    
74        return useBc ? (InputStream)new CipherInputStream(bytes, cipher) : (InputStream)new javax.crypto.CipherInputStream(bytes, cipher);
                    
75    }
                    
79        // cast required for earlier JDK
                    
80        return useBc ? (OutputStream)new CipherOutputStream(bytes, cipher) : (OutputStream)new javax.crypto.CipherOutputStream(bytes, cipher);
                    
81    }
                    
346        {
                    
347            // javax.crypto.CipherInputStream/CipherOutputStream
                    
348            // are broken wrt handling AEAD failures
                    
360        {
                    
361            // javax.crypto.CipherInputStream/CipherOutputStream
                    
362            // are broken wrt handling AEAD failures
                    
460    {
                    
461        final String[] blockCiphers64 = new String[]{"BLOWFISH", "DES", "DESEDE", "TEA", "CAST5", "RC2", "XTEA"};
                    
462
                    
                
CipherStreamTest.java https://gitlab.com/edgardo001/bc-java | Java | 706 lines
                    
10import org.bouncycastle.crypto.BufferedBlockCipher;
                    
11import org.bouncycastle.crypto.CipherParameters;
                    
12import org.bouncycastle.crypto.StreamCipher;
                    
13import org.bouncycastle.crypto.engines.AESEngine;
                    
14import org.bouncycastle.crypto.engines.BlowfishEngine;
                    
15import org.bouncycastle.crypto.engines.CAST5Engine;
                    
395        {
                    
396            // javax.crypto.CipherInputStream/CipherOutputStream
                    
397            // are broken wrt handling AEAD failures
                    
                
BlockCipherTest.java https://github.com/jsiwek/BouncyCastleSSLv3.git | Java | 932 lines
                    
6
                    
7import javax.crypto.Cipher;
                    
8import javax.crypto.CipherInputStream;
                    
8import javax.crypto.CipherInputStream;
                    
9import javax.crypto.CipherOutputStream;
                    
10import javax.crypto.IllegalBlockSizeException;
                    
50        "d4de46d52274dbb029f33b076043f8c40089f906751623de29f33b076043f8c4ac99b90f9396cb04",
                    
51        "Blowfish",
                    
52        "7870ebe7f6a52803eb9396ba6c5198216ce81d76d8d4c74beb9396ba6c5198211212473b05214e9f",
                    
80        "ceebcc2e5e2b847f9ed797b4930b95f115b9e6cf49c457fc2ea0df79ad5c8334",
                    
81        "Blowfish/CBC/NoPadding",
                    
82        "80823abbabc109733e7ebf3ce3344d67fc387c306b782086b452f7fbe8e844ce",
                    
104        "ceebcc2e5e2b847f9ed797b4930b95f115b9e6cf49c457fc2ea0df79ad5c8334df7042de5db89c96",
                    
105        "Blowfish/CBC/PKCS7Padding",
                    
106        "80823abbabc109733e7ebf3ce3344d67fc387c306b782086b452f7fbe8e844cef986562ab1a675e8",
                    
                
CodecAndCryptoTest.java https://gitlab.com/0072016/0072016-show | Java | 203 lines
                    
12
                    
13import javax.crypto.Cipher;
                    
14import java.security.*;
                    
161    public void testBlowfishCipherService() {
                    
162        BlowfishCipherService blowfishCipherService = new BlowfishCipherService();
                    
163        blowfishCipherService.setKeySize(128);
                    
165        //生成key
                    
166        Key key = blowfishCipherService.generateNewKey();
                    
167
                    
170        //加密
                    
171        String encrptText = blowfishCipherService.encrypt(text.getBytes(), key.getEncoded()).toHex();
                    
172        //解密
                    
172        //解密
                    
173        String text2 = new String(blowfishCipherService.decrypt(Hex.decode(encrptText), key.getEncoded()).getBytes());
                    
174
                    
                
AESUtil.java https://bitbucket.org/invest/anyoption.git | Java | 148 lines
                    
15import javax.crypto.BadPaddingException;
                    
16import javax.crypto.Cipher;
                    
17import javax.crypto.IllegalBlockSizeException;
                    
74	private enum SupportedEncryption {
                    
75		AES, BLOWFISH;
                    
76	}
                    
82		switch (systemEncryption) {
                    
83		case BLOWFISH:
                    
84			return Encryptor.encryptStringToString(plainText);
                    
103		switch (systemEncryption) {
                    
104		case BLOWFISH:
                    
105			return Encryptor.decryptStringToString(encryptedString);
                    
                
hostiplex.py https://gitlab.com/darezik/iptvplayer-for-e2 | Python | 296 lines
                    
10from Plugins.Extensions.IPTVPlayer.libs.youtube_dl.utils import clean_html
                    
11from Plugins.Extensions.IPTVPlayer.libs.crypto.cipher import blowfish
                    
12###################################################
                    
97            s3 = ''
                    
98            cipher = blowfish.Blowfish(key)
                    
99            for index in range(0, len(s2)/16):
                    
                
transport.py https://gitlab.com/Smileyt/KomodoEdit | Python | 1195 lines
                    
65
                    
66from Crypto.Cipher import Blowfish, AES, DES3, ARC4
                    
67try:
                    
96
                    
97    _preferred_ciphers = ('aes128-ctr', 'aes256-ctr', 'aes128-cbc', 'blowfish-cbc',
                    
98                          'aes256-cbc', '3des-cbc', 'arcfour128', 'arcfour256')
                    
106        'aes256-ctr': {'class': AES, 'mode': AES.MODE_CTR, 'block-size': 16, 'key-size': 32},
                    
107        'blowfish-cbc': {'class': Blowfish, 'mode': Blowfish.MODE_CBC, 'block-size': 8, 'key-size': 16},
                    
108        'aes128-cbc': {'class': AES, 'mode': AES.MODE_CBC, 'block-size': 16, 'key-size': 16},
                    
                
transport.py https://github.com/squarefactor/paramiko.git | Python | 1243 lines
                    
52#     http://nitace.bsd.uchicago.edu:8080/hashtar
                    
53from Crypto.Cipher import Blowfish, AES, DES3, ARC4
                    
54from Crypto.Hash import SHA, MD5
                    
202
                    
203    _preferred_ciphers = ( 'aes128-ctr', 'aes256-ctr', 'aes128-cbc', 'blowfish-cbc', 'aes256-cbc', '3des-cbc',
                    
204        'arcfour128', 'arcfour256' )
                    
212        'aes256-ctr': { 'class': AES, 'mode': AES.MODE_CTR, 'block-size': 16, 'key-size': 32 },
                    
213        'blowfish-cbc': { 'class': Blowfish, 'mode': Blowfish.MODE_CBC, 'block-size': 8, 'key-size': 16 },
                    
214        'aes128-cbc': { 'class': AES, 'mode': AES.MODE_CBC, 'block-size': 16, 'key-size': 16 },
                    
                
SIDCrypto.py https://gitlab.com/bcolin/sid | Python | 193 lines
                    
1from Crypto.Cipher import AES,Blowfish,CAST,DES3
                    
2from Crypto.Hash import MD5,SHA256,SHA512
                    
30
                    
31algos = {"AES":AES, "Blowfish":Blowfish, "CAST":CAST, "DES3":DES3, "SHA256":SHA256, "SHA512":SHA512, \
                    
32         "MD5":MD5, "None":Null}
                    
                
SecretUtils.java https://gitlab.com/JingYing/paipaiapp | Java | 152 lines
                    
5
                    
6import javax.crypto.Cipher;
                    
7import javax.crypto.SecretKey;
                    
                
galaxyweb_interface.py https://bitbucket.org/xeme/galaxy-central | Python | 108 lines
                    
19
                    
20from Crypto.Cipher import Blowfish
                    
21from Crypto.Util.randpool import RandomPool
                    
100    def encode_id(self,  obj_id ):
                    
101        id_cipher = Blowfish.new( self.config_id_secret )
                    
102        # Convert to string
                    
                
SilverCryptFactorySymetric.java https://github.com/NicolasEYSSERIC/Silverpeas-Core.git | Java | 138 lines
                    
30import java.security.NoSuchAlgorithmException;
                    
31import javax.crypto.Cipher;
                    
32import javax.crypto.NoSuchPaddingException;
                    
35
                    
36  public static final String ALGORITHM = "Blowfish";
                    
37  /**
                    
                
BlockCipherFactory.java https://github.com/8nevil8/ganymed-ssh-2.git | Java | 130 lines
                    
4 */
                    
5package ch.ethz.ssh2.crypto.cipher;
                    
6
                    
39		/* Higher Priority First */
                    
40		ciphers.add(new CipherEntry("aes128-ctr", 16, 16, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
41		ciphers.add(new CipherEntry("aes192-ctr", 16, 24, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
42		ciphers.add(new CipherEntry("aes256-ctr", 16, 32, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
43		ciphers.add(new CipherEntry("blowfish-ctr", 8, 16, "ch.ethz.ssh2.crypto.cipher.BlowFish"));
                    
44
                    
44
                    
45		ciphers.add(new CipherEntry("aes128-cbc", 16, 16, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
46		ciphers.add(new CipherEntry("aes192-cbc", 16, 24, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
47		ciphers.add(new CipherEntry("aes256-cbc", 16, 32, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
48		ciphers.add(new CipherEntry("blowfish-cbc", 8, 16, "ch.ethz.ssh2.crypto.cipher.BlowFish"));
                    
49
                    
                
CipherFactory.java https://github.com/penberg/classpath.git | Java | 129 lines
                    
38
                    
39package gnu.javax.crypto.cipher;
                    
40
                    
75      result = new Anubis();
                    
76    else if (name.equalsIgnoreCase(BLOWFISH_CIPHER))
                    
77      result = new Blowfish();
                    
116    hs.add(ANUBIS_CIPHER);
                    
117    hs.add(BLOWFISH_CIPHER);
                    
118    hs.add(DES_CIPHER);
                    
                
__init__.py https://github.com/dbcls/dbcls-galaxy.git | Python | 60 lines
                    
5
                    
6from Crypto.Cipher import Blowfish
                    
7from Crypto.Util.randpool import RandomPool
                    
37        self.id_secret = config['id_secret']
                    
38        self.id_cipher = Blowfish.new( self.id_secret )
                    
39    def encode_id( self, id ):
                    
                
backend.py https://gitlab.com/Mirros/XX-net | Python | 244 lines
                    
10from cryptography.exceptions import InternalError
                    
11from cryptography.hazmat.backends.commoncrypto.ciphers import (
                    
12    _CipherContext, _GCMCipherContext
                    
20from cryptography.hazmat.primitives.ciphers.algorithms import (
                    
21    AES, ARC4, Blowfish, CAST5, TripleDES
                    
22)
                    
191            self._register_cipher_adapter(
                    
192                Blowfish,
                    
193                self._lib.kCCAlgorithmBlowfish,
                    
                
ERXAbstractBlowfishCrypter.java https://github.com/dbaillon/wonder.git | Java | 226 lines
                    
14/**
                    
15 * ERXAbstractBlowfishCrypter is a blowfish implementation of the crypter
                    
16 * interface that allows subclasses to override the source of the blowfish key.
                    
17 * The blowfish cipher is a two-way cipher meaning the original string that was
                    
18 * encrypted can be retrieved. The way that this version of the blowfish cipher
                    
19 * is encrypted it is safe to use as a form value.
                    
22 */
                    
23public abstract class ERXAbstractBlowfishCrypter implements ERXCrypterInterface {
                    
24	public static final Logger log = Logger.getLogger(ERXCrypto.class);
                    
75		try {
                    
76			Cipher cipher = Cipher.getInstance("Blowfish/ECB/NoPadding");
                    
77			cipher.init(mode, secretBlowfishKey());
                    
179	 * Blowfish encodes a given string using the secret key specified in the
                    
180	 * System property: <b>ERBlowfishCipherKey</b>. The blowfish cipher is a
                    
181	 * two way cipher meaning that given the secret key you can de-cipher what
                    
                
Eryptogram.java http://liweistudy.googlecode.com/svn/trunk/ | Java | 145 lines
                    
12 */
                    
13import javax.crypto.Cipher;
                    
14import javax.crypto.KeyGenerator;
                    
24	private static String Algorithm = "DES";
                    
25	// ?? ????,?? DES,DESede,Blowfish
                    
26	static boolean debug = false;
                    
                
gdata.Crypto.Cipher.html https://github.com/bixbydev/Bixby.git | HTML | 51 lines
                    
2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
                    
3<html><head><title>Python: package gdata.Crypto.Cipher</title>
                    
4</head><body bgcolor="#f0f0f8">
                    
23&nbsp;<br>
                    
24Crypto.Cipher.AES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Advanced&nbsp;Encryption&nbsp;Standard<br>
                    
25Crypto.Cipher.ARC2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Alleged&nbsp;RC2<br>
                    
26Crypto.Cipher.ARC4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Alleged&nbsp;RC4<br>
                    
27Crypto.Cipher.Blowfish<br>
                    
28Crypto.Cipher.CAST<br>
                    
28Crypto.Cipher.CAST<br>
                    
29Crypto.Cipher.DES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;Data&nbsp;Encryption&nbsp;Standard.&nbsp;&nbsp;Very&nbsp;commonly&nbsp;used<br>
                    
30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;the&nbsp;past,&nbsp;but&nbsp;today&nbsp;its&nbsp;56-bit&nbsp;keys&nbsp;are&nbsp;too&nbsp;small.<br>
                    
30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;the&nbsp;past,&nbsp;but&nbsp;today&nbsp;its&nbsp;56-bit&nbsp;keys&nbsp;are&nbsp;too&nbsp;small.<br>
                    
31Crypto.Cipher.DES3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Triple&nbsp;DES.<br>
                    
32Crypto.Cipher.IDEA<br>
                    
                
StringEncrypter.java https://github.com/bowler-framework/recursivity-commons.git | Java | 240 lines
                    
4// CIPHER / GENERATORS
                    
5import javax.crypto.Cipher;
                    
6import javax.crypto.SecretKey;
                    
195            SecretKey desKey       = KeyGenerator.getInstance("DES").generateKey();
                    
196            SecretKey blowfishKey  = KeyGenerator.getInstance("Blowfish").generateKey();
                    
197            SecretKey desedeKey    = KeyGenerator.getInstance("DESede").generateKey();
                    
200            StringEncrypter desEncrypter = new StringEncrypter(desKey, desKey.getAlgorithm());
                    
201            StringEncrypter blowfishEncrypter = new StringEncrypter(blowfishKey, blowfishKey.getAlgorithm());
                    
202            StringEncrypter desedeEncrypter = new StringEncrypter(desedeKey, desedeKey.getAlgorithm());
                    
205            String desEncrypted       = desEncrypter.encrypt(secretString);
                    
206            String blowfishEncrypted  = blowfishEncrypter.encrypt(secretString);
                    
207            String desedeEncrypted    = desedeEncrypter.encrypt(secretString);
                    
210            String desDecrypted       = desEncrypter.decrypt(desEncrypted);
                    
211            String blowfishDecrypted  = blowfishEncrypter.decrypt(blowfishEncrypted);
                    
212            String desedeDecrypted    = desedeEncrypter.decrypt(desedeEncrypted);
                    
                
transport.py https://github.com/timjdavey/fabric.git | Python | 1234 lines
                    
52#     http://nitace.bsd.uchicago.edu:8080/hashtar
                    
53from Crypto.Cipher import Blowfish, AES, DES3
                    
54from Crypto.Hash import SHA, MD5
                    
198
                    
199    _preferred_ciphers = ( 'aes128-cbc', 'blowfish-cbc', 'aes256-cbc', '3des-cbc' )
                    
200    _preferred_macs = ( 'hmac-sha1', 'hmac-md5', 'hmac-sha1-96', 'hmac-md5-96' )
                    
205    _cipher_info = {
                    
206        'blowfish-cbc': { 'class': Blowfish, 'mode': Blowfish.MODE_CBC, 'block-size': 8, 'key-size': 16 },
                    
207        'aes128-cbc': { 'class': AES, 'mode': AES.MODE_CBC, 'block-size': 16, 'key-size': 16 },
                    
                
AbstractBlowfishCipher.java https://gitlab.com/rwf/blowfish-hasher | Java | 51 lines
                    
1package org.filho.util.blowfish.cipher;
                    
2
                    
5
                    
6import javax.crypto.Cipher;
                    
7import javax.crypto.NoSuchPaddingException;
                    
9
                    
10import org.filho.util.blowfish.hasher.Mode;
                    
11
                    
12/**
                    
13 * Contains all the methods to manipulate the blowfish hashes.
                    
14 * @author Roberto Filho
                    
16 */
                    
17public abstract class AbstractBlowfishCipher {
                    
18
                    
19	public Cipher getCipher(Mode mode, SecretKeySpec keySpec) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {
                    
20		// Use blowfish with ECB and PKCS5 padding
                    
21		Cipher cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding"); 
                    
                
models.py https://github.com/roadhead/satchmo.git | Python | 106 lines
                    
5
                    
6from Crypto.Cipher import Blowfish
                    
7from datetime import datetime
                    
66        secret_key = settings.SECRET_KEY
                    
67        encryption_object = Blowfish.new(secret_key)
                    
68        # block cipher length must be a multiple of 8
                    
93        secret_key = settings.SECRET_KEY
                    
94        encryption_object = Blowfish.new(secret_key)
                    
95        # strip padding from decrypted credit card number
                    
                
BlowfishCbc.java http://ece01sd.googlecode.com/svn/trunk/ | Java | 129 lines
                    
36
                    
37import javax.crypto.Cipher;
                    
38import javax.crypto.NoSuchPaddingException;
                    
48 */
                    
49public class BlowfishCbc extends SshCipher {
                    
50    private static Log log = LogFactory.getLog(BlowfishCbc.class);
                    
52    /**  */
                    
53    protected static String algorithmName = "blowfish-cbc";
                    
54    Cipher cipher;
                    
56    /**
                    
57     * Creates a new BlowfishCbc object.
                    
58     */
                    
58     */
                    
59    public BlowfishCbc() {
                    
60    }
                    
                
transport.py https://github.com/ewxrjk/paramiko.git | Python | 1243 lines
                    
48from Crypto import Random
                    
49from Crypto.Cipher import Blowfish, AES, DES3, ARC4
                    
50from Crypto.Hash import SHA, MD5
                    
198
                    
199    _preferred_ciphers = ( 'aes128-ctr', 'aes256-ctr', 'aes128-cbc', 'blowfish-cbc', 'aes256-cbc', '3des-cbc',
                    
200        'arcfour128', 'arcfour256' )
                    
208        'aes256-ctr': { 'class': AES, 'mode': AES.MODE_CTR, 'block-size': 16, 'key-size': 32 },
                    
209        'blowfish-cbc': { 'class': Blowfish, 'mode': Blowfish.MODE_CBC, 'block-size': 8, 'key-size': 16 },
                    
210        'aes128-cbc': { 'class': AES, 'mode': AES.MODE_CBC, 'block-size': 16, 'key-size': 16 },
                    
                
pct-speedtest.py https://gitlab.com/Smileyt/KomodoEdit | Python | 220 lines
                    
30from Crypto.PublicKey import RSA
                    
31from Crypto.Cipher import AES, ARC2, ARC4, Blowfish, CAST, DES3, DES, XOR
                    
32from Crypto.Hash import MD2, MD4, MD5, SHA256, SHA
                    
177            ("AES256", AES, 32),
                    
178            ("Blowfish(256)", Blowfish, 32),
                    
179            ("CAST(40)", CAST, 5),
                    
                
BlowfishKey.java https://github.com/muness/blowfish_encryption_example.git | Java | 74 lines
                    
1import javax.crypto.Cipher;
                    
2import java.security.Key;
                    
17
                    
18public class BlowfishKey {
                    
19
                    
34    public static byte[] encrypt(String plainText) throws Exception {
                    
35        Cipher cipher = Cipher.getInstance("Blowfish");
                    
36        cipher.init(Cipher.ENCRYPT_MODE, getKeySpec());
                    
48    public static String decrypt(byte[] cipherText) throws Exception {
                    
49        Cipher cipher = Cipher.getInstance("Blowfish");
                    
50        cipher.init(Cipher.DECRYPT_MODE, getKeySpec());
                    
58        byte[] raw = getKey();
                    
59        return (new SecretKeySpec(raw, "Blowfish"));
                    
60    }
                    
                
__init__.py https://github.com/andyhhp/pycrypto.git | Python | 82 lines
                    
41======================    ====================
                    
42Crypto.Cipher.AES         Advanced Encryption Standard
                    
43Crypto.Cipher.ARC2        Alleged RC2
                    
44Crypto.Cipher.ARC4        Alleged RC4
                    
45Crypto.Cipher.Blowfish    Blowfish
                    
46Crypto.Cipher.CAST        CAST
                    
46Crypto.Cipher.CAST        CAST
                    
47Crypto.Cipher.DES         The Data Encryption Standard.
                    
48                          Very commonly used in the past,
                    
49                          but today its 56-bit keys are too small.
                    
50Crypto.Cipher.DES3        Triple DES.
                    
51Crypto.Cipher.XOR         The simple XOR cipher.
                    
66========================    =======================
                    
67Crypto.Cipher.PKCS1_v1.5    PKCS#1 v1.5 encryption, based on RSA key pairs
                    
68Crypto.Cipher.PKCS1_OAEP    PKCS#1 OAEP encryption, based on RSA key pairs
                    
                
models.py https://github.com/CulturePlex/Sylva.git | Python | 161 lines
                    
2import binascii
                    
3from Crypto.Cipher import Blowfish
                    
4
                    
144            return u""
                    
145        enc_obj = Blowfish.new(settings.SECRET_KEY)
                    
146        hex_password = binascii.a2b_hex(self.encrypted_password)
                    
152        else:
                    
153            enc_obj = Blowfish.new(settings.SECRET_KEY)
                    
154            repeat = 8 - (len(value) % 8)
                    
                
CipherSpecTest.cfc https://github.com/damonmiller/esapi4cf.git | ColdFusion CFScript | 252 lines
                    
12 */
                    
13import "org.owasp.esapi.crypto.CipherSpec";
                    
14
                    
30
                    
31		variables.dfltAESCipher   = createObject("java", "javax.crypto.Cipher").getInstance("AES");
                    
32		variables.dfltECBCipher   = createObject("java", "javax.crypto.Cipher").getInstance("AES/ECB/NoPadding");
                    
32		variables.dfltECBCipher   = createObject("java", "javax.crypto.Cipher").getInstance("AES/ECB/NoPadding");
                    
33		variables.dfltOtherCipher = createObject("java", "javax.crypto.Cipher").getInstance("Blowfish/OFB8/PKCS5Padding");
                    
34
                    
72    	assertTrue(!isNull(variables.cipherSpec));
                    
73    	assertTrue( variables.cipherSpec.getCipherAlgorithm() == "Blowfish");
                    
74    	assertTrue( variables.cipherSpec.getCipherMode() == "OFB8");
                    
154	public void function testGetCipherAlgorithm() {
                    
155		assertTrue( variables.cipherSpec.getCipherAlgorithm() == "Blowfish");
                    
156	}
                    
                
BlockCipherResetTest.java https://gitlab.com/edgardo001/bc-java | Java | 206 lines
                    
3import org.bouncycastle.crypto.BlockCipher;
                    
4import org.bouncycastle.crypto.CipherParameters;
                    
5import org.bouncycastle.crypto.DataLengthException;
                    
9import org.bouncycastle.crypto.engines.AESLightEngine;
                    
10import org.bouncycastle.crypto.engines.BlowfishEngine;
                    
11import org.bouncycastle.crypto.engines.CAST5Engine;
                    
62        testReset("DESEngine", new DESEngine(), new DESEngine(), new KeyParameter(new byte[8]));
                    
63        testReset("BlowfishEngine", new BlowfishEngine(), new BlowfishEngine(), new KeyParameter(new byte[8]));
                    
64        testReset("CAST5Engine", new CAST5Engine(), new CAST5Engine(), new KeyParameter(new byte[8]));
                    
                
cipher.py git://git.savannah.nongnu.org/sshproxy.git | Python | 318 lines
                    
22
                    
23from Crypto.Cipher import Blowfish
                    
24import base64
                    
120
                    
121class BlowfishCipher(BaseCipher):
                    
122    cipher_id = "blowfish"
                    
132            secret = getattr(cls, 'secret', get_config('blowfish')['secret'])
                    
133        return Blowfish.new(secret, Blowfish.MODE_ECB)
                    
134
                    
198    newsecret = ''
                    
199    if cipher_type == 'blowfish':
                    
200        if conf['sshproxy']['cipher_type'] == 'blowfish':
                    
200        if conf['sshproxy']['cipher_type'] == 'blowfish':
                    
201            print("Recipher from blowfish to blowfish does not work "
                    
202                  "at the moment.\nPlease recipher to base64 first, "
                    
                
fileconfigmanager.py https://github.com/donaldharvey/snappy.git | Python | 135 lines
                    
4import os
                    
5from Crypto.Cipher import Blowfish #for password storage
                    
6from hashlib import sha1
                    
52		cryptkey = sha1(key).hexdigest()
                    
53		bf = Blowfish.new(cryptkey, Blowfish.MODE_ECB)
                    
54		encrypted_pass = bf.encrypt(self._pad_pass(password))
                    
59		cryptkey = sha1(key).hexdigest()
                    
60		bf = Blowfish.new(cryptkey, Blowfish.MODE_ECB)
                    
61		try:
                    
                
common.py https://bitbucket.org/chapmanb/galaxy-central/ | Python | 167 lines
                    
13pkg_resources.require( "pycrypto" )
                    
14from Crypto.Cipher import Blowfish
                    
15from Crypto.Util.randpool import RandomPool
                    
19    # Utility method to encode ID's
                    
20    id_cipher = Blowfish.new( config_id_secret )
                    
21    # Convert to string
                    
                
Primitive.hs git://github.com/vincenthz/hs-cryptocipher.git | Haskell | 421 lines
                    
1-- |
                    
2-- Module      : Crypto.Cipher.Blowfish.Primitive
                    
3-- License     : BSD-style
                    
6
                    
7-- Crypto.Cipher.Blowfish.Primitive, copyright (c) 2012 Stijn van Drongelen
                    
8-- based on: BlowfishAux.hs (C) 2002 HardCore SoftWare, Doug Hoyte
                    
10
                    
11module Crypto.Cipher.Blowfish.Primitive
                    
12    ( Context
                    
61                             (fromIntegral d) ) : w8tow32 xs
                    
62    w8tow32 _ = error $ "internal error: Crypto.Cipher.Blowfish:keyFromByteString"
                    
63
                    
92                | x < 1042 = (BF p s0 s1 s2 (s3//[(x-786,nl),(x-785,nr)]))
                    
93                | otherwise = error "internal error: Crypto.Cipher.Blowfish:procKey "
                    
94
                    
                
Blowfish.java https://gitlab.com/edgardo001/bc-java | Java | 88 lines
                    
25        {
                    
26            super(new BlowfishEngine());
                    
27        }
                    
61        {
                    
62            return "Blowfish IV";
                    
63        }
                    
68    {
                    
69        private static final String PREFIX = Blowfish.class.getName();
                    
70
                    
81            provider.addAlgorithm("KeyGenerator.BLOWFISH", PREFIX + "$KeyGen");
                    
82            provider.addAlgorithm("Alg.Alias.KeyGenerator", MiscObjectIdentifiers.cryptlib_algorithm_blowfish_CBC, "BLOWFISH");
                    
83            provider.addAlgorithm("AlgorithmParameters.BLOWFISH", PREFIX + "$AlgParams");
                    
83            provider.addAlgorithm("AlgorithmParameters.BLOWFISH", PREFIX + "$AlgParams");
                    
84            provider.addAlgorithm("Alg.Alias.AlgorithmParameters", MiscObjectIdentifiers.cryptlib_algorithm_blowfish_CBC, "BLOWFISH");
                    
85
                    
                
gpass.py https://github.com/dcreager/revelation.git | Python | 439 lines
                    
29import locale, re
                    
30from Crypto.Cipher import Blowfish
                    
31from Crypto.Hash import SHA
                    
44	key		= SHA.new(password).digest()
                    
45	cipher		= Blowfish.new(key, Blowfish.MODE_CBC, IV)
                    
46
                    
80	key	= SHA.new(password).digest()
                    
81	cipher	= Blowfish.new(key, Blowfish.MODE_CBC, IV)
                    
82
                    
                
BlockCipherFactory.java https://github.com/northern-bites/ganymed-ssh2.git | Java | 115 lines
                    
1
                    
2package ch.ethz.ssh2.crypto.cipher;
                    
3
                    
35
                    
36		ciphers.addElement(new CipherEntry("aes256-ctr", 16, 32, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
37		ciphers.addElement(new CipherEntry("aes192-ctr", 16, 24, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
38		ciphers.addElement(new CipherEntry("aes128-ctr", 16, 16, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
39		ciphers.addElement(new CipherEntry("blowfish-ctr", 8, 16, "ch.ethz.ssh2.crypto.cipher.BlowFish"));
                    
40
                    
40
                    
41		ciphers.addElement(new CipherEntry("aes256-cbc", 16, 32, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
42		ciphers.addElement(new CipherEntry("aes192-cbc", 16, 24, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
43		ciphers.addElement(new CipherEntry("aes128-cbc", 16, 16, "ch.ethz.ssh2.crypto.cipher.AES"));
                    
44		ciphers.addElement(new CipherEntry("blowfish-cbc", 8, 16, "ch.ethz.ssh2.crypto.cipher.BlowFish"));
                    
45		
                    
                
SecurePropertyManager.java https://bitbucket.org/adroitlogic/ultraesb/ | Java | 207 lines
                    
35
                    
36import javax.crypto.Cipher;
                    
37import javax.crypto.spec.SecretKeySpec;
                    
53
                    
54    private String algorithm = "Blowfish";
                    
55    private String password = "jaas is the way";
                    
150     * <p/>
                    
151     * The default algorithm is Blowfish, and the password is the default used in JBoss AS
                    
152     * <p/>
                    
                
BlowFishKey.java https://github.com/ichiro101/l2adena-l2j-core.git | Java | 74 lines
                    
20
                    
21import javax.crypto.Cipher;
                    
22
                    
33 */
                    
34public class BlowFishKey extends BaseRecievePacket
                    
35{
                    
35{
                    
36	protected static final Logger _log = Logger.getLogger(BlowFishKey.class.getName());
                    
37	/**
                    
39	 */
                    
40	public BlowFishKey(byte[] decrypt, GameServerThread server)
                    
41	{
                    
61			
                    
62			server.SetBlowFish(new NewCrypt(key));
                    
63			if (Config.DEBUG)
                    
                
encrypted.py git://github.com/RuudBurger/CouchPotatoServer.git | Python | 125 lines
                    
6encrypted and safely encoded for storage in a unicode column using the powerful
                    
7and secure Blowfish Cipher using a specified "secret" which can be passed into
                    
8the plugin at class declaration time.
                    
34
                    
35from Crypto.Cipher import Blowfish
                    
36from elixir.statements import Statement
                    
53def encrypt_value(value, secret):
                    
54    return Blowfish.new(secret, Blowfish.MODE_CFB) \
                    
55                   .encrypt(value).encode('string_escape')
                    
57def decrypt_value(value, secret):
                    
58    return Blowfish.new(secret, Blowfish.MODE_CFB) \
                    
59                   .decrypt(value.decode('string_escape'))
                    
                
Blowfish.hs git://github.com/vincenthz/hs-cryptocipher.git | Haskell | 61 lines
                    
2-- |
                    
3-- Module      : Crypto.Cipher.Blowfish
                    
4-- License     : BSD-style
                    
27-- | 128 bit keyed blowfish state
                    
28newtype Blowfish128 = Blowfish128 Context
                    
29
                    
38    cipherKeySize _ = KeySizeRange 6 56
                    
39    cipherInit k = either error Blowfish $ initBlowfish (toBytes k)
                    
40
                    
58INSTANCE_CIPHER(Blowfish64, "blowfish64", 8)
                    
59INSTANCE_CIPHER(Blowfish128, "blowfish128", 16)
                    
60INSTANCE_CIPHER(Blowfish256, "blowfish256", 32)
                    
60INSTANCE_CIPHER(Blowfish256, "blowfish256", 32)
                    
61INSTANCE_CIPHER(Blowfish448, "blowfish448", 56)
                    
62
                    
                
 

Source

Language