Using Native PGP Encryption and Decryption in NetSuite

07/17/2025

With the release of NetSuite 2025.1, a long-awaited feature is finally here: native support for Pretty Good Privacy (PGP) encryption and decryption via the new N/pgp module. This enhancement simplifies secure data exchanges within NetSuite and eliminates the need for third-party middleware, reducing costs and streamlining system architecture.

Executive Summary

NetSuite 2025.1 introduces native PGP encryption and decryption through the new N/pgp module, removing the need for third-party tools or custom SuiteScript workarounds. This guide shows how to use it to secure and exchange sensitive files directly within NetSuite.

Why PGP Matters in NetSuite Integrations

In today’s interconnected environments - especially those involving sensitive customer, financial, or proprietary data - encryption is no longer optional. From APIs to third-party integrations, businesses must ensure that data in transit is protected against interception and tampering.

PGP is a trusted, standards-based approach to securing data. It uses asymmetric encryption, allowing one key to encrypt and a different (private) key to decrypt - ensuring both confidentiality and authenticity. Before 2025.1, NetSuite developers had to rely on external iPaaS platforms like Boomi, Celigo, or Workato to integrate this level of security. Now, that functionality lives natively in NetSuite.

Native Encryption with the N/pgp Module

NetSuite’s N/pgp module provides secure methods to encrypt messages using public/private key pairs stored in NetSuite’s API Secrets record. These secrets are securely managed and accessed via script IDs.

The function below retrieves encryption keys and uses them to encrypt a message and apply a digital signature. If the private key is passphrase-protected, a securely stored passphrase is also retrieved.

SuiteScript encryptMessage function using the N/pgp module to load keys from secrets and encrypt

This process results in an armored, ASCII-formatted output, ideal for transmitting across systems while maintaining security and traceability.

Decryption: Reversing the Process Securely

Decrypting messages is equally straightforward. The code below demonstrates how the N/pgp module retrieves the appropriate decryption keys, parses the encrypted message, and verifies its signature before returning the plaintext.

Bg Image

White paper

title-continuedsuccess-2

What if NetSuite support actually worked?

See the Continued Success difference.

Get the Whitepaper

SuiteScript decryptMessage function using N/pgp to parse, decrypt and verify an armored message

This pattern ensures message integrity while leveraging centralized, auditable key storage through the Secrets record.

Important Limitations to Consider

While the new N/pgp module is a powerful step forward, developers should be aware of its constraints:

  • Key generation is not supported: All PGP key management must be done externally.
  • Only string data types are supported - no streaming or large file handling.
  • The module requires that entire messages fit into memory during encryption and decryption.
  • Messages must be compatible with standard PGP software to ensure interoperability.

These limitations mean careful architectural planning is still required. But for many use cases, native PGP support will significantly reduce friction and improve the security posture of NetSuite implementations.

The Bigger Picture: NetSuite’s Growing Security Capabilities

As NetSuite continues to evolve, its embrace of native security tooling shows a deeper commitment to supporting enterprise-grade requirements. The N/pgp module offers an immediate win for teams who previously had to engineer workarounds to handle encrypted data securely. The same native-first approach works for printing: you can pass custom data into Advanced PDF templates without a Suitelet.

Whether you're syncing sensitive customer records or exchanging financial information with third parties, native PGP support empowers developers to keep security in-house - closer to the business logic and easier to manage.

In short: fewer tools, stronger integrations, and more secure workflows.

Talk to a NetSuite Expert

Tell us what you're working on, and we'll help you figure out the next step.

Frequently Asked Questions About NetSuite Native PGP Encryption

What is PGP encryption and why is it important for NetSuite integrations?

PGP (Pretty Good Privacy) is a standards-based asymmetric encryption protocol that uses a public key to encrypt data and a private key to decrypt it, ensuring only the intended recipient can read sensitive information. In NetSuite integrations, PGP is commonly required for EDI file exchanges, banking data transfers, healthcare record sharing, and any integration where data in transit must be protected against interception or tampering.

What is the N/pgp module in NetSuite?

The N/pgp module is a native SuiteScript module introduced in NetSuite 2025.1 that provides PGP encryption and decryption capabilities directly within NetSuite. It allows SuiteScript developers to encrypt messages using public keys, decrypt messages using private keys, and apply digital signatures, all without requiring external middleware or iPaaS platforms like Boomi, Celigo, or Workato to handle the cryptographic operations.

How does native PGP in NetSuite compare to using middleware for encryption?

Before 2025.1, PGP encryption in NetSuite integrations required routing data through an external iPaaS platform or middleware layer to perform the cryptographic operations before sending or after receiving. Native PGP via N/pgp eliminates this middleware dependency, reducing architecture complexity, lowering licensing costs for the middleware layer, and keeping sensitive data within the NetSuite security boundary rather than passing it through a third-party system.

How are PGP keys stored and managed in NetSuite?

PGP keys used with the N/pgp module are stored in NetSuite's API Secrets record, a secure, encrypted storage mechanism designed for sensitive credentials and keys. Scripts access these secrets via their assigned Script IDs, ensuring the raw key material is never exposed in script source code or logs. Passphrases for passphrase-protected private keys are also stored as API Secrets and retrieved securely at runtime.

What types of integrations benefit most from NetSuite's native PGP module?

Integrations that commonly require PGP encryption include: EDI file exchanges with trading partners, SFTP-based financial data transfers with banks, healthcare data exchanges requiring HIPAA-compliant encryption, government reporting submissions with mandatory encryption requirements, and any integration sending sensitive personally identifiable information (PII) or financial data to external systems. Native N/pgp makes all of these patterns implementable without leaving NetSuite.

How can Techfino help implement PGP-secured integrations in NetSuite?

Techfino's SuiteScript developers can implement N/pgp-based encryption in new or existing NetSuite integrations, including key management setup in API Secrets, encryption/decryption SuiteScript implementation, and testing against trading partner requirements. We help clients migrate away from middleware-based PGP solutions to the simpler, more cost-effective native approach. Contact Techfino to discuss your integration security requirements.

Which NetSuite version is required to use the native N/pgp module?

Native PGP encryption and decryption arrived with NetSuite 2025.1 through the N/pgp module. Accounts on 2025.1 or later can encrypt and decrypt data natively, removing the need for third-party middleware in secure integrations.