PageRenderTime 42ms queryTime 38ms sortTime 0ms getByIdsTime 94ms findMatchingLines 72ms

100+ results results for 'crypto.cip blowfish' (42 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
                    
                
CryptoUtil.java https://github.com/interdroid/interdroid-util.git | Java | 367 lines
                    
44import javax.crypto.BadPaddingException;
                    
45import javax.crypto.Cipher;
                    
46import javax.crypto.IllegalBlockSizeException;
                    
75	 */
                    
76	public static final String DEFAULT_CYPHER = "Blowfish";
                    
77	/**
                    
                
JCEStreamCipher.java https://gitlab.com/brian0218/rk3188_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
                    
                
PEMUtilities.java https://bitbucket.org/festevezga/xobotos.git | Java | 280 lines
                    
12
                    
13import javax.crypto.Cipher;
                    
14import javax.crypto.SecretKey;
                    
167        {
                    
168            alg = "Blowfish";
                    
169            sKey = getKey(password, alg, 16, iv);
                    
                
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://bitbucket.org/rlyspn/androidrr.git | 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        }
                    
                
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);
                    
                
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 ):
                    
                
BookmarksReader.java https://github.com/codebling/VFSJFileChooser2.git | Java | 218 lines
                    
33import java.util.logging.Logger;
                    
34import javax.crypto.Cipher;
                    
35import javax.crypto.spec.SecretKeySpec;
                    
114
                    
115				SecretKeySpec skeyspec = new SecretKeySpec(raw, "Blowfish");
                    
116				Cipher cipher = Cipher.getInstance("Blowfish");
                    
                
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);
                    
                
encrypted.py https://bitbucket.org/vitormazzi/skink.git | Python | 106 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.
                    
28
                    
29from Crypto.Cipher          import Blowfish
                    
30from elixir.statements      import Statement
                    
41def encrypt_value(value, secret):
                    
42    return Blowfish.new(secret, Blowfish.MODE_CFB) \
                    
43                   .encrypt(value).encode('string_escape')
                    
45def decrypt_value(value, secret):
                    
46    return Blowfish.new(secret, Blowfish.MODE_CFB) \
                    
47                   .decrypt(value.decode('string_escape'))
                    
                
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),
                    
                
CipherWithWrappingSpi.java https://github.com/ikeji/openjdk7-jdk.git | 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
                    
                
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
                    
                
TestLadderEncoding.java https://github.com/ickik/TestLadder.git | Java | 131 lines
                    
8import javax.crypto.BadPaddingException;
                    
9import javax.crypto.Cipher;
                    
10import javax.crypto.IllegalBlockSizeException;
                    
24
                    
25	private static final String ALGORITHM = "Blowfish";
                    
26	private static final String TRANSFORMATION = "Blowfish/CBC/PKCS5Padding";
                    
34	 * stored in local.
                    
35	 * <br>The algorithm chooses is blowfish.
                    
36	 * @param login the login of the user used as key.
                    
37	 * @param password the password associates to the login.
                    
38	 * @return the password encrypted with blowfish algorithm.
                    
39	 * @throws LadderException this exception is thrown when an error occurs
                    
69	 * stored in local.
                    
70	 * <br>The algorithm chooses is blowfish.
                    
71	 * @param login the login of the user used as key.
                    
                
test_Blowfish.py https://gitlab.com/Smileyt/KomodoEdit | 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
                    
                
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 {
                    
                
ERXAbstractBlowfishCrypter.java https://github.com/hprange/wonder.git | Java | 222 lines
                    
12/**
                    
13 * ERXAbstractBlowfishCrypter is a blowfish implementation of the crypter
                    
14 * interface that allows subclasses to override the source of the blowfish key.
                    
15 * The blowfish cipher is a two-way cipher meaning the original string that was
                    
16 * encrypted can be retrieved. The way that this version of the blowfish cipher
                    
17 * is encrypted it is safe to use as a form value.
                    
20 */
                    
21public abstract class ERXAbstractBlowfishCrypter implements ERXCrypterInterface {
                    
22	/** Block size of blowfish encrypted strings */
                    
71		try {
                    
72			Cipher cipher = Cipher.getInstance("Blowfish/ECB/NoPadding");
                    
73			cipher.init(mode, secretBlowfishKey());
                    
175	 * Blowfish encodes a given string using the secret key specified in the
                    
176	 * System property: <b>ERBlowfishCipherKey</b>. The blowfish cipher is a
                    
177	 * two way cipher meaning that given the secret key you can de-cipher what
                    
                
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	 */
                    
                
BlockCipherFactory.java https://bitbucket.org/zielmicha/connectbot.git | 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 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>.
                    
                
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>.
                    
                
Turkish.java https://github.com/ikeji/openjdk7-jdk.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
                    
                
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):
                    
                
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));
                    
                
JCEKeyGenerator.java https://github.com/MIPS/external-bouncycastle.git | Java | 538 lines
                    
2
                    
3import org.bouncycastle.crypto.CipherKeyGenerator;
                    
4import org.bouncycastle.crypto.KeyGenerationParameters;
                    
174    /**
                    
175     * Blowfish
                    
176     */
                    
176     */
                    
177    public static class Blowfish
                    
178        extends JCEKeyGenerator
                    
179    {
                    
180        public Blowfish()
                    
181        {
                    
181        {
                    
182            super("Blowfish", 128, new CipherKeyGenerator());
                    
183        }
                    
                
ERXAbstractBlowfishCrypter.java https://bitbucket.org/molequedeideias/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
                    
                
JCEStreamCipher.java https://bitbucket.org/festevezga/xobotos.git | Java | 526 lines
                    
9
                    
10import javax.crypto.Cipher;
                    
11import javax.crypto.NoSuchPaddingException;
                    
21import org.bouncycastle.crypto.BlockCipher;
                    
22import org.bouncycastle.crypto.CipherParameters;
                    
23import org.bouncycastle.crypto.DataLengthException;
                    
26// BEGIN android-removed
                    
27// import org.bouncycastle.crypto.engines.BlowfishEngine;
                    
28// import org.bouncycastle.crypto.engines.DESEngine;
                    
418    // /**
                    
419    //  * Blowfish
                    
420    //  */
                    
420    //  */
                    
421    // static public class Blowfish_CFB8
                    
422    //     extends JCEStreamCipher
                    
                
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;
                    
                
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;
                    
                
EncryptedPrivateKeyInfoTest.java https://gitlab.com/brian0218/rk3288_r-box_android4.4.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"},
                    
                
BlowFish.java https://gitlab.com/brian0218/rk3188_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://bitbucket.org/festevezga/xobotos.git | 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
                    
                
fish.py https://github.com/freshprince/weechat-fish.git | Python | 1034 lines
                    
22#
                    
23# NOTE: Blowfish and DH1080 implementation is licenced under a different
                    
24# license:
                    
76try:
                    
77    import Crypto.Cipher.Blowfish
                    
78except ImportError:
                    
188##
                    
189# Blowfish and DH1080 Code:
                    
190##
                    
200                key = key[:72]
                    
201            self.blowfish = Crypto.Cipher.Blowfish.new(
                    
202                    key.encode('utf-8'), Crypto.Cipher.Blowfish.MODE_ECB)
                    
275
                    
276        cbcCipher = Crypto.Cipher.Blowfish.new(
                    
277                key.encode('utf-8'), Crypto.Cipher.Blowfish.MODE_CBC, iv)
                    
                
BlowFish.java https://bitbucket.org/zielmicha/irssiconnectbot.git | 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{
                    
                
GnuCrypto.java https://bitbucket.org/pizzafactory/pf-gcc.git | 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());
                    
                
Blowfish.java https://bitbucket.org/pizzafactory/pf-gcc.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
                    
                
__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
                    
                
test.py https://bitbucket.org/kinkudi/palplex.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://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
                    
                
transport.py https://github.com/analogue/mythbox.git | Python | 1362 lines
                    
20from Crypto import Util
                    
21from Crypto.Cipher import XOR
                    
22
                    
143                        'aes128-ctr', 'aes128-cbc', 'cast128-ctr',
                    
144                        'cast128-cbc', 'blowfish-ctr', 'blowfish-cbc',
                    
145                        '3des-ctr', '3des-cbc'] # ,'none']
                    
                
transport.py https://bitbucket.org/fernandosanchezjr/paramiko-keyboard-interactive.git | Python | 1246 lines
                    
51from Crypto import Random
                    
52from Crypto.Cipher import Blowfish, AES, DES3, ARC4
                    
53from Crypto.Hash import SHA, MD5
                    
201
                    
202    _preferred_ciphers = ( 'aes128-ctr', 'aes256-ctr', 'aes128-cbc', 'blowfish-cbc', 'aes256-cbc', '3des-cbc',
                    
203        'arcfour128', 'arcfour256' )
                    
211        'aes256-ctr': { 'class': AES, 'mode': AES.MODE_CTR, 'block-size': 16, 'key-size': 32 },
                    
212        'blowfish-cbc': { 'class': Blowfish, 'mode': Blowfish.MODE_CBC, 'block-size': 8, 'key-size': 16 },
                    
213        'aes128-cbc': { 'class': AES, 'mode': AES.MODE_CBC, 'block-size': 16, 'key-size': 16 },
                    
                
JCEStreamCipher.java https://github.com/MIPS/external-bouncycastle.git | Java | 604 lines
                    
3import org.bouncycastle.crypto.BlockCipher;
                    
4import org.bouncycastle.crypto.CipherParameters;
                    
5import org.bouncycastle.crypto.DataLengthException;
                    
8// BEGIN android-removed
                    
9// import org.bouncycastle.crypto.engines.BlowfishEngine;
                    
10// import org.bouncycastle.crypto.engines.DESEngine;
                    
27
                    
28import javax.crypto.Cipher;
                    
29import javax.crypto.NoSuchPaddingException;
                    
422    // /**
                    
423    //  * Blowfish
                    
424    //  */
                    
424    //  */
                    
425    // static public class Blowfish_CFB8
                    
426    //     extends JCEStreamCipher
                    
                
JCEBlockCipher.java https://github.com/MIPS/external-bouncycastle.git | Java | 1377 lines
                    
4import org.bouncycastle.crypto.BufferedBlockCipher;
                    
5import org.bouncycastle.crypto.CipherParameters;
                    
6import org.bouncycastle.crypto.DataLengthException;
                    
8import org.bouncycastle.crypto.engines.AESFastEngine;
                    
9import org.bouncycastle.crypto.engines.BlowfishEngine;
                    
10// BEGIN android-removed
                    
67import javax.crypto.BadPaddingException;
                    
68import javax.crypto.Cipher;
                    
69import javax.crypto.IllegalBlockSizeException;
                    
                
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
                    
                
__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
                    
                
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:
                    
                
Cipher.java https://github.com/duncanmak/jruby-ossl.git | Java | 778 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";
                    
195            if ("bf".equalsIgnoreCase(cryptoBase)) {
                    
196                cryptoBase = "Blowfish";
                    
197            }
                    
265                    try {
                    
266                        if ((javax.crypto.Cipher.getMaxAllowedKeyLength(name) / 8) < keyLen) {
                    
267                            keyLen = javax.crypto.Cipher.getMaxAllowedKeyLength(name) / 8;
                    
292        try {
                    
293            javax.crypto.Cipher.getInstance(cryptoMode);
                    
294            return true;
                    
                
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)
                    
                
DiffieHellman.scala https://github.com/xrayn/tpm-scala.git | Scala | 160 lines
                    
7import scala.util.Random
                    
8import javax.crypto.Cipher
                    
9import javax.crypto.KeyGenerator
                    
29
                    
30  def encryptBlowfish(aesKey: String, peerPubKey: Option[String]): Option[String] = {
                    
31
                    
37          val sharedKey = getSharedKey().toString().getBytes()
                    
38          val myKeySpec = new SecretKeySpec(sharedKey, "Blowfish");
                    
39          val cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding");
                    
50
                    
51  def decryptBlowfish(aesKey: String, peerPubKey: Option[String]): Option[String] = {
                    
52
                    
60          val sharedKey = getSharedKey().toString().getBytes()
                    
61          val myKeySpec = new SecretKeySpec(sharedKey, "Blowfish");
                    
62          val cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding");
                    
                
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
                    
                
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
                    
                
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
                    
                
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'}
                    
                
BlowfishEngine.java https://github.com/bambar/bitcoin-android.git | Java | 576 lines
                    
3import com.google.bitcoin.bouncycastle.crypto.BlockCipher;
                    
4import com.google.bitcoin.bouncycastle.crypto.CipherParameters;
                    
5import com.google.bitcoin.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
                    
                
old.py https://bitbucket.org/yiwang/proxy-gfw.git | Python | 638 lines
                    
30    class Crypto:
                    
31        _BlockSize = {'AES':16, 'ARC2':8, 'ARC4':1, 'Blowfish':8, 'CAST':8,
                    
32                      'DES':8, 'DES3':8, 'IDEA':8, 'RC5':8, 'XOR':1}
                    
60            if self.cipher=='RC5' and self.keysize in (1, 57): self.keysize=32
                    
61            #try to import Crypto.Cipher.xxxx
                    
62            try:
                    
62            try:
                    
63                cipherlib = __import__('Crypto.Cipher.'+self.cipher, fromlist='x')
                    
64                self._newobj = cipherlib.new
                    
                
config.py https://github.com/ahri/financials.git | Python | 47 lines
                    
5
                    
6from Crypto.Cipher import Blowfish as crypto
                    
7import simplejson as json
                    
                
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://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
                    
                
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>
                    
                
__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:
                    
                
Cryption.java https://github.com/aharisu/SyncBookmark.git | Java | 68 lines
                    
6import javax.crypto.BadPaddingException;
                    
7import javax.crypto.Cipher;
                    
8import javax.crypto.IllegalBlockSizeException;
                    
17public class Cryption {
                    
18	private static final String TRANSFORMATION = "Blowfish";
                    
19	
                    
27			Cipher cipher = Cipher.getInstance(TRANSFORMATION);
                    
28			cipher.init(javax.crypto.Cipher.ENCRYPT_MODE, spec);
                    
29			return cipher.doFinal(text.getBytes());
                    
50			Cipher cipher = Cipher.getInstance(TRANSFORMATION);
                    
51			cipher.init(javax.crypto.Cipher.DECRYPT_MODE, spec);
                    
52			return new String(cipher.doFinal(encrypted));
                    
                
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
                    
                
CryptoSecurityUtils.java https://bitbucket.org/pymma/openesb-components.git | Java | 146 lines
                    
33
                    
34import javax.crypto.Cipher;
                    
35import javax.crypto.KeyGenerator;
                    
44    private Cipher decipher;
                    
45    private String algorithm = "Blowfish";
                    
46    private File KEY_STORE_FILE = new File("sipbc.jks");
                    
                
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
                    
                
BlowfishJC.java https://github.com/aldago/DQLScriptExecutor.git | Java | 180 lines
                    
7
                    
8import javax.crypto.Cipher;
                    
9import javax.crypto.spec.SecretKeySpec;
                    
12 * 
                    
13 * Blowfish encrypt/decrypt algorithm wrappers around the Java Crypto API 
                    
14 * implementation
                    
18 */
                    
19public class BlowfishJC
                    
20{
                    
21    
                    
22    private BlowfishJC()
                    
23    {
                    
38     * Algo Specs:
                    
39     * Blowfish/ECB/PKCS5Padding
                    
40     * 
                    
                
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);
                    
                
transport.py https://bitbucket.org/vitormazzi/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 },
                    
                
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):
                    
                
BookmarksWriter.java https://github.com/codebling/VFSJFileChooser2.git | Java | 172 lines
                    
32import javax.crypto.BadPaddingException;
                    
33import javax.crypto.Cipher;
                    
34import javax.crypto.IllegalBlockSizeException;
                    
151
                    
152			SecretKeySpec skeyspec = new SecretKeySpec(raw, "Blowfish");
                    
153			Cipher cipher = Cipher.getInstance("Blowfish");
                    
                
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 },
                    
                
CipherFactory.java https://bitbucket.org/pizzafactory/pf-gcc.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);
                    
                
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  /**
                    
                
Blowfish.java https://bitbucket.org/festevezga/xobotos.git | Java | 69 lines
                    
22        {
                    
23            super(new BlowfishEngine());
                    
24        }
                    
40        {
                    
41            super("Blowfish", 128, new CipherKeyGenerator());
                    
42        }
                    
58        {
                    
59            put("Cipher.BLOWFISH", "org.bouncycastle.jce.provider.symmetric.Blowfish$ECB");
                    
60            // BEGIN android-removed
                    
62            // END android-removed
                    
63            put("KeyGenerator.BLOWFISH", "org.bouncycastle.jce.provider.symmetric.Blowfish$KeyGen");
                    
64            put("Alg.Alias.KeyGenerator.1.3.6.1.4.1.3029.1.2", "BLOWFISH");
                    
64            put("Alg.Alias.KeyGenerator.1.3.6.1.4.1.3029.1.2", "BLOWFISH");
                    
65            put("AlgorithmParameters.BLOWFISH", "org.bouncycastle.jce.provider.symmetric.Blowfish$AlgParams");
                    
66            put("Alg.Alias.AlgorithmParameters.1.3.6.1.4.1.3029.1.2", "BLOWFISH");
                    
                
__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,
                    
                
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;
                    
                
 

Source

Language