Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uk.gov.dwp.crypto:secure-strings

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uk.gov.dwp.crypto:secure-strings

Utility for storing passwords in memory encrypted form to prevent heap inspection

  • 1.5.3
  • Source
  • Maven
  • Socket score

Version published
Maintainers
2
Source

secure-strings

Build Status Known Vulnerabilities

This project is to make it easy to store passwords in an encrypted form using a cipher that is constructed inside the application and is different for every instance.

This was created to mitigate the Heap_Inspection vulnerability:-

String variables are immutable - in other words, once a string variable is assigned, its value cannot be changed or removed. Thus, these strings may remain around in memory, possibly in multiple locations, for an indefinite period of time until the garbage collector happens to remove it. Sensitive data, such as passwords, will remain exposed in memory as plaintext with no control over their lifetime.

Project inclusion

properties entry in pom

<properties>
    <dwp.securestrings.version>x.x</dwp.securestrings.version>
</properties>

dependency reference

<dependency>
    <groupId>uk.gov.dwp.crypto</groupId>
    <artifactId>secure-strings</artifactId>
    <version>${dwp.securestrings.version}</version>
</dependency>
Example of use
import uk.gov.dwp.crypto.SecureStrings;
import javax.crypto.SealedObject;

Standard implementation

public class Pojo {
    private SecureStrings secureStrings = new SecureStrings();
    private SealedObject password = null;

    public String getPassword() {
        return secureStrings.revealString(password);
    }

    public void setPassword(String password) {
        this.password = secureStrings.sealString(password);
    }
}

Injected class

public class Pojo {
    private SecureStrings secureStrings = null;
    private SealedObject password = null;

    @Inject
    public Pojo(SecureStrings secureStrings) {
        this.secureStrings = secureStrings;
    }

    public String getPassword() {
        return secureStrings.revealString(password);
    }

    public void setPassword(String password) {
        this.password = secureStrings.sealString(password);
    }
}

FAQs

Package last updated on 15 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc