Skip to content

Commit

Permalink
Merge pull request #176 from rahulbeeram12/feature/encrypt-aws-share
Browse files Browse the repository at this point in the history
feature: Encrypt AWS Share & Store it in DB
  • Loading branch information
cb7chaitanya authored Sep 18, 2024
2 parents 68efca4 + 965053b commit 3b12ca4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/actions/pvtKeyEncryptMgmt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import prisma from '@/db'
import { authOptions } from '@/lib/auth'
import { aesEncrypt } from '@/services/aes-module'
import { awsEncrypt } from '@/services/aws-kms-module'
import { splitSecret } from '@/services/keyShardingService'
import { getServerSession } from 'next-auth'

Expand All @@ -15,7 +16,11 @@ export async function pvtKeyEncryptionManager(privateKey: string) {

//AES Share 1 -> share encryption AES module
const aesEncryptedShare = aesEncrypt(aesShareString)
//AWS Share 2 -> share encryption AWS module
//AWS Share 2 -> share encryption AWS module
const awsEncryptedShare = await awsEncrypt(awsShareString, {
purpose: "tiplink",
country: "India"
});

//GCP Share 3 -> share encryption GCP module

Expand All @@ -27,7 +32,7 @@ export async function pvtKeyEncryptionManager(privateKey: string) {
},
data: {
aesShare: aesEncryptedShare,
awsShare: awsEncryptedShare
},
})
console.log(response)
}

0 comments on commit 3b12ca4

Please sign in to comment.