Friday, March 23, 2012

How to create encoded password that you can use for curl in CQ / WEM

Use Case: In Curl command most of the time you have to enter user credentials to perform CRUD operation. Some people might have security concern sharing admin password with other users.

Solution: You can use following java program to create encrypted password that you can use in curl command

import java.io.UnsupportedEncodingException;


public class Test {
public static void main(String[] args) {
String password = "admin";
try {
for (byte x : password.getBytes("UTF-8")) {
System.out.print("%" + Integer.toHexString((x & 255) + 256).substring(1));
}
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
}

1) Create Test.java
2) Copy paste above code
3) Run program by changing password value (Or pass it through command line arg)
4) Use output of program to use it in CURL

Special thanks to Thomas Mueller From Adobe for providing this information.

36 comments:

  1. It works only in java program , I was looking a solution to get worked in simple linux curl or curl with perl.

    --
    Sun

    ReplyDelete
  2. This obfuscates the password, it does not encrypt it.

    ReplyDelete
    Replies
    1. Thanks for comment. Yes you are right. For custom password usage you can use Crypto support in CQ5.5. Above example is just intended for internal IT use in case you don't want to share password.

      Delete
  3. This is an incredible rousing article.I am basically satisfied with your great work.You put truly exceptionally accommodating data...  Tech website

    ReplyDelete
  4. This Website is great for group chat and conversation. Thanks for sharing with us. like this website so much it's really awesome.I have also gone through your other posts too and they are also very much appreciate able and I'm just waiting for your next update to come as I like all your posts.

    Copa America 2019 fixture
    Top 10 Gadgets Review
    EcoHeat S Review
    Mosquitron Review
    ThePhotoStick Review
    DroneX Pro Review

    ReplyDelete
  5. Thanks for the information, I have bookmarked your blog and will share this on social media. Check here for mosquitron review
    ecoheat s review

    ReplyDelete
  6. You are writing some interesting and best content I also bookmark this URL .You guys are writing some Amazing tips. Thanks for sharing this. Totally Awesome Post Please Keep Posting Regularly.
    echobeat earbuds review
    chargeboost reviews
    liporing review
    doc socks
    livewave antenna review
    livewave antenna

    ReplyDelete
  7. Replies
    1. http://demo.logger.co.kr/source.php?url=http://darellsfinancialcorner.blogspot.com/2016/10/download-karbonn-aura-power-stock-rom.html
      http://scoringcentral.mattiaswestlund.net/member.php?action=profile&uid=757
      http://www.wemblog.com/2012/03/how-to-create-encoded-password-that-you.html

      Delete
    2. This comment has been removed by the author.

      Delete
  8. I am a blogger at EverydaysGadgets.com and frequently write reviews about latest and trending gadgets. You can check my latest article on photostick review. It is an amazing backup device that is quite popular these days.

    ReplyDelete
  9. This Website is great for group chat and conversation. Thanks for sharing with us. like this website so much it's really awesome.I have also gone through your other posts too and they are also very much appreciate able and I'm just waiting for your next update to come as I like all your posts.

    The Other Track
    Radiation Stopper Pro
    Top gadgets to buy in 2020
    Q Grip Wax remover
    UV Clenizer Zoom Disinfectant robot
    X watch smartwatch
    Keysmart key oranizer

    ReplyDelete
  10. This Website is great for group chat and conversation. Thanks for sharing with us. like this website so much it's really awesome.I have also gone through your other posts too and they are also very much appreciate able and I'm just waiting for your next update to come as I like all your posts.

    Best Gadget Review
    DartleType Laser Keyboard Review
    sleepconnection anti snore review 2020

    ReplyDelete
  11. A smart automotive device that comes with a diagnostic app, helps you in watching the health of your automotive. investigate our Fixd Review to understand a lot of.Buy Now And Get 50% Off.

    Fixed CAR Diagonostic Tool

    ReplyDelete
  12. I liked reading the previous article, it really explains everything in detail, the article is very interesting and effective. Thank you and good luck in the following articles.
    shein return policy||shein return policy usa||shein returns policy||shein refund policy||shein exchange policy||how do i return to shein||

    ReplyDelete
  13. Fever patrol Thermometer device to keep your family safe and protected.Buy it now on cheapest price.

    Fever Patrol Thermometer Review

    ReplyDelete
  14. FitTrack Body BMI Scale have created a few health and fitness products to use alongside their easy-to-use app.Buy it now on cheapest price and get 50% Off.


    FitTrack BMI Scale

    ReplyDelete

  15. Mobile Klean UV Sanitizer is an ultraviolet light sanitizer, which uses a flash of ultraviolet light to eliminate virtually all bacteria and viruses.Buy Now and Get 50% Off.

    Mobile Klean Sanitizer

    ReplyDelete
  16. Smart Sanitizer Pro is like a small box with a power cord and it is technically designed for perfect sanitizing for smart phones.Buy on cheapest price. Limited Offer.

    Smart Sanitizer Pro

    ReplyDelete
  17. Muama Enence is a portable translator device that can translate into more than 40 languages in real time. Buy now and get 50% Off.Hurry Up!

    Mauma Enence Translator

    ReplyDelete

  18. WildSurvive Pro is a survival kit that claims to contain all of the tools needed for outdoor survival.Buy now on cheapest price and get 60% Off.

    Wildsurvive Pro Outdoor Kit

    ReplyDelete
  19. CleaniX UV Sanitizer is a sanitizing device. Buy now and get 50% Off.

    Cleanix UV Sanitizer Review

    ReplyDelete
  20. Washzilla Laundry Ball is AN eco-friendly thanks to wash garments because it saves water and energy. it's safe for sensitive skin and keeps garments tidy.Buy now and get 50% Off.

    Washzilla Laundry Ball Review

    ReplyDelete
  21. The XWatch may be a smartwatch designed with 2 things in mind. Quality and elegance. it's a high-end smartwatch with millions of attention-grabbing options.Buy now on cheapest price.HURRY!

    Xwatch Smartwatch Review

    ReplyDelete
  22. This is a really great article, thank you for sharing this valuable piece of content with us, I will pray for you to get more revenue to this content thank you. You and your reader may also like to read about article of SnoreStop Review!

    ReplyDelete
  23. This is a great blog, thank you very much for sharing this valuable information with us.
    TikiTunes Review
    Vizr Review
    Thephotostick review

    ReplyDelete
  24. Explore more compelling articles on this topic on this site, guys.
    visionpro
    visionpro review
    visionpro reviews

    ReplyDelete
  25. Nice topic and post, you have did great job. Your product research and your knowledge is also awesome. Keep it Up. Aculief Review 2020

    ReplyDelete