Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for ciphertexts (0.15 sec)

  1. 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 May 05 19:28:20 GMT 2024
    - Last Modified: Fri Mar 01 21:09:42 GMT 2024
    - 7.9K bytes
    - Viewed (0)
  2. internal/kms/kms.go

    	// DecryptKey decrypts the ciphertext with the key referenced
    	// by the key ID. The context must match the context value
    	// used to generate the ciphertext.
    	DecryptKey(keyID string, ciphertext []byte, context Context) ([]byte, error)
    
    	// DecryptAll decrypts all ciphertexts with the key referenced
    	// by the key ID. The contexts must match the context value
    	// used to generate the ciphertexts.
    Go
    - Registered: Sun May 05 19:28:20 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 May 05 19:28:20 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 May 05 19:28:20 GMT 2024
    - Last Modified: Tue Jul 19 01:54:27 GMT 2022
    - 3K bytes
    - Viewed (0)
  5. internal/crypto/metadata_test.go

    }{
    	{ETag: "", IsSealed: false},                                  // 0
    	{ETag: "90682b8e8cc7609c4671e1d64c73fc30", IsSealed: false},  // 1
    	{ETag: "f201040c9dc593e39ea004dc1323699bcd", IsSealed: true}, // 2 not valid ciphertext but looks like sealed ETag
    	{ETag: "20000f00fba2ee2ae4845f725964eeb9e092edfabc7ab9f9239e8344341f769a51ce99b4801b0699b92b16a72fa94972", IsSealed: true}, // 3
    }
    
    func TestIsETagSealed(t *testing.T) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Feb 02 00:13:57 GMT 2024
    - 18.7K bytes
    - Viewed (0)
  6. cmd/kms-handlers.go

    			return
    		}
    		writeSuccessResponseJSON(w, resp)
    		return
    	}
    
    	// 2. Verify that we can indeed decrypt the (encrypted) key
    	decryptedKey, err := GlobalKMS.DecryptKey(key.KeyID, key.Ciphertext, kmsContext)
    	if err != nil {
    		response.DecryptionErr = err.Error()
    		resp, err := json.Marshal(response)
    		if err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Mar 01 21:09:42 GMT 2024
    - 20.7K bytes
    - Viewed (0)
  7. 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 May 05 19:28:20 GMT 2024
    - Last Modified: Mon Mar 06 16:56:10 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  8. 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 May 05 19:28:20 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 2.2K 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 May 05 19:28:20 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 May 05 19:28:20 GMT 2024
    - Last Modified: Sat Feb 12 00:51:25 GMT 2022
    - 13.8K bytes
    - Viewed (0)
Back to top