Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for Ciphertext (0.59 sec)

  1. internal/kms/dek_test.go

    		}
    		if key.Plaintext != nil {
    			t.Fatalf("Test %d: unmarshaled DEK contains non-nil plaintext", i)
    		}
    		if !bytes.Equal(key.Ciphertext, test.Key.Ciphertext) {
    			t.Fatalf("Test %d: ciphertext mismatch: got %x - want %x", i, key.Ciphertext, test.Key.Ciphertext)
    		}
    	}
    }
    
    func mustDecodeB64(s string) []byte {
    	b, err := base64.StdEncoding.DecodeString(s)
    	if err != nil {
    		panic(err)
    	}
    	return b
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 2.2K bytes
    - Viewed (0)
  2. internal/kms/kms.go

    	_ encoding.TextUnmarshaler = (*DEK)(nil)
    )
    
    // MarshalText encodes the DEK's key ID and ciphertext
    // as JSON.
    func (d DEK) MarshalText() ([]byte, error) {
    	type JSON struct {
    		KeyID      string `json:"keyid"`
    		Ciphertext []byte `json:"ciphertext"`
    	}
    	return json.Marshal(JSON{
    		KeyID:      d.KeyID,
    		Ciphertext: d.Ciphertext,
    	})
    }
    
    // UnmarshalText tries to decode text as JSON representation
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Mar 01 21:09:42 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  3. internal/kms/kes.go

    		return nil, err
    	}
    	return c.client.Decrypt(context.Background(), keyID, ciphertext, ctxBytes)
    }
    
    func (c *kesClient) DecryptAll(ctx context.Context, keyID string, ciphertexts [][]byte, contexts []Context) ([][]byte, error) {
    	c.lock.RLock()
    	defer c.lock.RUnlock()
    
    	plaintexts := make([][]byte, 0, len(ciphertexts))
    	for i := range ciphertexts {
    		ctxBytes, err := contexts[i].MarshalText()
    		if err != nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Apr 16 15:43:39 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  4. internal/kms/single-key_test.go

    		if err != nil {
    			t.Fatalf("Test %d: failed to decode plaintext key: %v", i, err)
    		}
    		ciphertext, err := base64.StdEncoding.DecodeString(test.Ciphertext)
    		if err != nil {
    			t.Fatalf("Test %d: failed to decode ciphertext key: %v", i, err)
    		}
    		plaintext, err := KMS.DecryptKey(test.KeyID, ciphertext, test.Context)
    		if err != nil {
    			t.Fatalf("Test %d: failed to decrypt key: %v", i, err)
    		}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jul 19 01:54:27 GMT 2022
    - 3K bytes
    - Viewed (0)
  5. src/main/java/jcifs/smb1/util/DES.java

        }
    
    
        /// Encrypt a block of bytes.
        public void encrypt( byte[] clearText, byte[] cipherText )  {
            encrypt( clearText, 0, cipherText, 0 );
        }
    
        /// Decrypt a block of bytes.
        public void decrypt( byte[] cipherText, byte[] clearText ) {
    
            decrypt( cipherText, 0, clearText, 0 );
        }
    
        /**
         * encrypts an array where the length must be a multiple of 8
    Java
    - Registered: Sun Apr 28 00:10:09 GMT 2024
    - Last Modified: Fri Mar 22 20:39:42 GMT 2019
    - 21.4K bytes
    - Viewed (0)
  6. internal/kms/single-key.go

    		}
    	}
    	return plaintext, nil
    }
    
    func (kms secretKey) DecryptAll(_ context.Context, keyID string, ciphertexts [][]byte, contexts []Context) ([][]byte, error) {
    	plaintexts := make([][]byte, 0, len(ciphertexts))
    	for i := range ciphertexts {
    		plaintext, err := kms.DecryptKey(keyID, ciphertexts[i], contexts[i])
    		if err != nil {
    			return nil, err
    		}
    		plaintexts = append(plaintexts, plaintext)
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Mar 01 21:09:42 GMT 2024
    - 7.9K bytes
    - Viewed (0)
  7. internal/config/crypto_test.go

    	if err != nil {
    		t.Fatalf("Failed to create KMS: %v", err)
    	}
    
    	for i, test := range encryptDecryptTests {
    		ciphertext, err := Encrypt(KMS, bytes.NewReader(test.Data), test.Context)
    		if err != nil {
    			t.Fatalf("Test %d: failed to encrypt stream: %v", i, err)
    		}
    		data, err := io.ReadAll(ciphertext)
    		if err != nil {
    			t.Fatalf("Test %d: failed to encrypt stream: %v", i, err)
    		}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.2K bytes
    - Viewed (0)
  8. internal/config/crypto.go

    // The context is bound to the returned ciphertext.
    //
    // The same context must be provided when decrypting the
    // ciphertext.
    func EncryptBytes(k kms.KMS, plaintext []byte, context kms.Context) ([]byte, error) {
    	ciphertext, err := Encrypt(k, bytes.NewReader(plaintext), context)
    	if err != nil {
    		return nil, err
    	}
    	return io.ReadAll(ciphertext)
    }
    
    // DecryptBytes decrypts the ciphertext using a key managed by the KMS.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Mar 06 16:56:10 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  9. cmd/encryption-v1.go

    		if err != nil {
    			return err
    		}
    		sealedKey = objectKey.Seal(newKey.Plaintext, crypto.GenerateIV(rand.Reader), crypto.S3.String(), bucket, object)
    		crypto.S3.CreateMetadata(metadata, newKey.KeyID, newKey.Ciphertext, sealedKey)
    		return nil
    	case crypto.S3KMS:
    		if GlobalKMS == nil {
    			return errKMSNotConfigured
    		}
    		objectKey, err := crypto.S3KMS.UnsealObjectKey(GlobalKMS, metadata, bucket, object)
    		if err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 36.5K bytes
    - Viewed (0)
  10. docs/security/README.md

                     |                         |                         |
                     |                         |                         |
    ciphertext  := sealed_chunk_0   ||       sealed_chunk_1   ||       sealed_chunk_2   ||       ...
    ```
    
    Plain Text
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Feb 12 00:51:25 GMT 2022
    - 13.8K bytes
    - Viewed (0)
Back to top