Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM Utility to Decrypt Password in AEM?

bsr78033597
Level 2
Level 2

Hi Experts,

 

I understand AEM provides an out of the box utility at /system/console/crypto to convert plain text passwords to encrypted password. However, we have a requirement to convert such encrypted password to plain text password for verification purposes at later point of time by Production support team. So, is there a utility that AEM provides to decrypt password ?

 

Edit - We are using 6.5 SP2.

 

Thanks.

crypto password
1 Accepted Solution
Nupur_Jain
Correct answer by
Community Advisor
Community Advisor

Hi @bsr78033597 

 

There is no OOTB option to decrypt the encrpted text from consoles. I would suggest if you really need this flexibility, you can do following:

  1. Register servlet using resourceType
  2. In servlet, you can pass encrypted text as some param like etext
  3. you can decrypt text in the servlet itself using Crypto Service and return the result as response like 

 

 

 

@Reference
private CryptoSupport cryptoSupport;

    @Override
    protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException {
        String etext = request.getParameter("etext");
        if(cryptoSupport.isProtected(etext)){
            String dtext = this.cryptoSuport.unProtect(etext);
            response.getWriter().write(dtext);
        }
        else{
            response.getWriter().write("Non Encrypted Text");
        }
}
​

 

 

 

  • Now create a node under /apps with property "sling:resourceType" equivalent to resource type with which your servlet was registerd. Creating it under apps will unsure that the servlet is only accessible to users with access to /apps read write.
  • you can now call you utility like http://<host>:<port>/apps/decrypt?etext=<encrypted-text>

 

Hope it helps!

Thanks!

Nupur

View solution in original post

1 Reply
Nupur_Jain
Correct answer by
Community Advisor
Community Advisor

Hi @bsr78033597 

 

There is no OOTB option to decrypt the encrpted text from consoles. I would suggest if you really need this flexibility, you can do following:

  1. Register servlet using resourceType
  2. In servlet, you can pass encrypted text as some param like etext
  3. you can decrypt text in the servlet itself using Crypto Service and return the result as response like 

 

 

 

@Reference
private CryptoSupport cryptoSupport;

    @Override
    protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException {
        String etext = request.getParameter("etext");
        if(cryptoSupport.isProtected(etext)){
            String dtext = this.cryptoSuport.unProtect(etext);
            response.getWriter().write(dtext);
        }
        else{
            response.getWriter().write("Non Encrypted Text");
        }
}
​

 

 

 

  • Now create a node under /apps with property "sling:resourceType" equivalent to resource type with which your servlet was registerd. Creating it under apps will unsure that the servlet is only accessible to users with access to /apps read write.
  • you can now call you utility like http://<host>:<port>/apps/decrypt?etext=<encrypted-text>

 

Hope it helps!

Thanks!

Nupur

View solution in original post