Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for NewTripleDESCipher (3.28 sec)

  1. src/crypto/des/example_test.go

    import "crypto/des"
    
    func ExampleNewTripleDESCipher() {
    	// NewTripleDESCipher can also be used when EDE2 is required by
    	// duplicating the first 8 bytes of the 16-byte key.
    	ede2Key := []byte("example key 1234")
    
    	var tripleDESKey []byte
    	tripleDESKey = append(tripleDESKey, ede2Key[:16]...)
    	tripleDESKey = append(tripleDESKey, ede2Key[:8]...)
    
    	_, err := des.NewTripleDESCipher(tripleDESKey)
    	if err != nil {
    		panic(err)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 697 bytes
    - Viewed (0)
  2. src/crypto/des/cipher.go

    }
    
    // A tripleDESCipher is an instance of TripleDES encryption.
    type tripleDESCipher struct {
    	cipher1, cipher2, cipher3 desCipher
    }
    
    // NewTripleDESCipher creates and returns a new [cipher.Block].
    func NewTripleDESCipher(key []byte) (cipher.Block, error) {
    	if len(key) != 24 {
    		return nil, KeySizeError(len(key))
    	}
    
    	c := new(tripleDESCipher)
    	c.cipher1.generateSubkeys(key[:8])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 4K bytes
    - Viewed (0)
  3. src/crypto/des/des_test.go

    		c, _ := des.NewTripleDESCipher(tt.key)
    		out := make([]byte, len(tt.in))
    		c.Encrypt(out, tt.in)
    
    		if !bytes.Equal(out, tt.out) {
    			t.Errorf("#%d: result: %x want: %x", i, out, tt.out)
    		}
    	}
    }
    
    func TestDecryptTripleDES(t *testing.T) {
    	for i, tt := range encryptTripleDESTests {
    		c, _ := des.NewTripleDESCipher(tt.key)
    
    		plain := make([]byte, len(tt.in))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 29 16:49:56 UTC 2023
    - 52.2K bytes
    - Viewed (0)
  4. src/crypto/x509/pem_decrypt.go

    	cipher:     PEMCipherDES,
    	name:       "DES-CBC",
    	cipherFunc: des.NewCipher,
    	keySize:    8,
    	blockSize:  des.BlockSize,
    }, {
    	cipher:     PEMCipher3DES,
    	name:       "DES-EDE3-CBC",
    	cipherFunc: des.NewTripleDESCipher,
    	keySize:    24,
    	blockSize:  des.BlockSize,
    }, {
    	cipher:     PEMCipherAES128,
    	name:       "AES-128-CBC",
    	cipherFunc: aes.NewCipher,
    	keySize:    16,
    	blockSize:  aes.BlockSize,
    }, {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 7.2K bytes
    - Viewed (0)
  5. src/crypto/tls/cipher_suites.go

    	}
    	return false
    }
    
    func cipherRC4(key, iv []byte, isRead bool) any {
    	cipher, _ := rc4.NewCipher(key)
    	return cipher
    }
    
    func cipher3DES(key, iv []byte, isRead bool) any {
    	block, _ := des.NewTripleDESCipher(key)
    	if isRead {
    		return cipher.NewCBCDecrypter(block, iv)
    	}
    	return cipher.NewCBCEncrypter(block, iv)
    }
    
    func cipherAES(key, iv []byte, isRead bool) any {
    	block, _ := aes.NewCipher(key)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"StreamWriter.W", Field, 0},
    	},
    	"crypto/des": {
    		{"(KeySizeError).Error", Method, 0},
    		{"BlockSize", Const, 0},
    		{"KeySizeError", Type, 0},
    		{"NewCipher", Func, 0},
    		{"NewTripleDESCipher", Func, 0},
    	},
    	"crypto/dsa": {
    		{"ErrInvalidPublicKey", Var, 0},
    		{"GenerateKey", Func, 0},
    		{"GenerateParameters", Func, 0},
    		{"L1024N160", Const, 0},
    		{"L2048N224", Const, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
  7. api/go1.txt

    pkg crypto/cipher, type StreamWriter struct, W io.Writer
    pkg crypto/des, const BlockSize ideal-int
    pkg crypto/des, func NewCipher([]uint8) (cipher.Block, error)
    pkg crypto/des, func NewTripleDESCipher([]uint8) (cipher.Block, error)
    pkg crypto/des, method (KeySizeError) Error() string
    pkg crypto/des, type KeySizeError int
    pkg crypto/dsa, const L1024N160 ParameterSizes
    pkg crypto/dsa, const L2048N224 ParameterSizes
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 14 18:58:28 UTC 2013
    - 1.7M bytes
    - Viewed (0)
Back to top