Download full key store from TLS protect cloud: Need sample payload in PowerShell script

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

Download full key store from TLS protect cloud: Need sample payload in PowerShell script

L0 Member
We are not able to process the JavaScript from ServiceNow, which is working well when we execute directly in MID Server.We have tried with a sample PowerShell script from ServiceNowwhich is working as expected so, we have converted the whole function from Java Script toPowerShell script and tried to execute which isnt working as expected. Please find the code below which we tried and let us know if it required any changes.$util = (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/dchest/tweetnacl-js/master/nacl-fast.js') [raw.githubusercontent.com] | Out-Null$key = "sGdZ7v57K6cMAd6gIb7IeJfQDmN561YDtSkMNxnykCU="$passPhrase = "VenafiNous123!"function encrypt($data, $key){ $encodedData = [Text.Encoding]::UTF8.GetBytes($data) $decodedKey = [Convert]::FromBase64String($key) $encryptedData = [nacl.sealedbox]::Create($encodedData, $decodedKey) return [Convert]::ToBase64String($encryptedData)}$encryptedKey = encrypt $passPhrase $keyWrite-Output $encryptedKey.
0 REPLIES 0
  • 45 Views
  • 0 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!