Encrypt & Decrypt user credentials | Crypto-JS | Playwright Tutorial - Part 89

  Рет қаралды 28,324

LetCode with Koushik

LetCode with Koushik

Күн бұрын

Пікірлер: 67
@MuthuPandi-qg6bc
@MuthuPandi-qg6bc Ай бұрын
If you store the encryption secret key on the client side, it can be exposed to public users. Is this a good practice, or is there a way to prevent exposing the secret key?
@letcode
@letcode Ай бұрын
For demo purposes I have shown like this. Secret keys are managed from your ci config or environment variables.
@MuthuPandi-qg6bc
@MuthuPandi-qg6bc Ай бұрын
@letcode but, The environment variables are shown on the client side, right?
@letcode
@letcode Ай бұрын
Somehow you have to pass that means it will show, this is industry standard so no worries.
@MuthuPandi-qg6bc
@MuthuPandi-qg6bc Ай бұрын
@@letcode okay understood, Is there a way to hide secrets from the client side?
@venkateshks662
@venkateshks662 Ай бұрын
​@@MuthuPandi-qg6bc yes. I'm also trying to hide the secret key.
@shreyashtewari7603
@shreyashtewari7603 6 ай бұрын
Hi Koushik I am implementing this concept in Framework and there are multiple specs file in the spec folder but this encryption and decryption file is implemented in only one file Could you please help me with the command to run the test by passing secret key as an argument
@letcode
@letcode 6 ай бұрын
Hi, you can create a function and call it wherever you decrypt the value.
@venkateshks662
@venkateshks662 Ай бұрын
Can you show how to hide secret key inside the project?
@letcode
@letcode Ай бұрын
Ok 👌
@navneetsharma8204
@navneetsharma8204 Жыл бұрын
What if I am using this in simple JS via using cdn for crypto I means i am trying to encypt the form data sending via ajax and in backend i am using node for decrypt that how i can do that? I am able to encrypt in ajax but when i post that data via ajax in node then how i can decrypt that
@letcode
@letcode Жыл бұрын
You can get the data from ajax and write a utility to get those data and decrypt using crypto js package.
@pradipvaghela3179
@pradipvaghela3179 Жыл бұрын
Hey brother can you provide a solution for this error " Browser has been closed at obejct". while runinng a particular code of the module it's working properly. But, while running the whole script it failed and give an error " Browser has been closed at obejct". can you please assist me how to resolve this for my script.🙏
@letcode
@letcode Жыл бұрын
Hi, not sure how you managed or shared the page object. It might be closing somewhere that causes other scrips to close.
@shreyashtewari7603
@shreyashtewari7603 7 ай бұрын
Hi koushik I am not able to enter the Secret key through the terminal It is showing error as the term SECRET_KEY is not defined. Please help me with the same
@letcode
@letcode 7 ай бұрын
R u using git bash as terminal?
@shreyashtewari7603
@shreyashtewari7603 6 ай бұрын
Thanks it helped
@adityamarzuk5970
@adityamarzuk5970 4 ай бұрын
@@letcode brother this comment help me so much i thought i cant decrypt it server side i read stackOverflow and ask chat gpt and no use but using git bash terminal it read the key why is it like that ?
@letcode
@letcode 4 ай бұрын
It is basically the way we set variables, I used githbash and the commands accordingly. If you are using a windows machine then the commands will be different.
@sagarsathyanarayanan6281
@sagarsathyanarayanan6281 Жыл бұрын
how would you save a password as secret key if its running with the pipelines. Then providing the password through terminal is not possible
@letcode
@letcode Жыл бұрын
Every pipeline supports secret keys, you have to pass using a secret key.
@pradipvaghela3179
@pradipvaghela3179 Жыл бұрын
when i do a code using type script it gives me the error in constructor(page). an erorr is "Parameter 'page' implicitly has an 'any' type, but a better type may be inferred from usage" and second is that, while using "this. page=page " it giving me error "Property 'page' does not exist on type 'LoginPage'.ts" for typescript. please give me the solution of this. thanks
@letcode
@letcode Жыл бұрын
You can explicitly declare the page reference. Eg. page:Page 2. You have to pass the page in the constructor , make sure the page is imported properly. You can look into my git code link in the description.
@dzboss5136
@dzboss5136 2 жыл бұрын
hi i want to automate vpn extention using selenium python how can do this please ???
@letcode
@letcode 2 жыл бұрын
This is selenium+ Java example kzbin.info/www/bejne/a16Vp6eZrp5_sLM
@MohamedAslam-h2i
@MohamedAslam-h2i Жыл бұрын
Hi bro, I have been using cypress with js not ts. problem is it's showing error in "data: string" and "data.username" parts. cypress console throws error as : Cannot read properties of undefined (reading 'words')
@letcode
@letcode Жыл бұрын
Hi bro. Only the import syntax will change, in js data:string cannot be used. it should be data only (without data type). You can also check the official docs for syntax.
@MohamedAslam-vu1jg
@MohamedAslam-vu1jg Жыл бұрын
@@letcode lysm koushik ❤️ thanks!!!
@wildlifebypk
@wildlifebypk Жыл бұрын
@ LetCode with Koushik which bit it's generating 256bit?
@letcode
@letcode Жыл бұрын
Various techniques are there, we can use any one of them.
@wildlifebypk
@wildlifebypk Жыл бұрын
@@letcode i wanna use 256bit only can you provide code?
@maheshtekawade3952
@maheshtekawade3952 Жыл бұрын
Using secret key anyone can get credentials right? If yes, then how can we execute tests in Jenkins? In Jenkins file we need to pass secret key with command.
@letcode
@letcode Жыл бұрын
In Jenkins you have an option to set the secret keys.
@maheshtekawade3952
@maheshtekawade3952 Жыл бұрын
@@letcode ok
@naveensingh7261
@naveensingh7261 Жыл бұрын
How to handle this if our backend is in SpringBoot? Reply would be appreciated
@letcode
@letcode Жыл бұрын
If you are asking about automation, then it doesn't matter with the back end. Encrypt and decrypt happens in your test code and decrypted value is passed to the application.
@naveensingh7261
@naveensingh7261 Жыл бұрын
@@letcode No, I want to encrypt password and send it to header, and I want to decrypt it in springboot side using same AES or any symmetric encryption technique. Thank you in advance
@letcode
@letcode Жыл бұрын
Hmm I'm not sure about it..
@shubhamweb-i2i
@shubhamweb-i2i 11 ай бұрын
How can we encrypt the url using crypto can u please explain?
@letcode
@letcode 11 ай бұрын
It should be the same as I have explained. R u facing any issue?
@ArunKumar-fq6ne
@ArunKumar-fq6ne Жыл бұрын
Hello bro is there any solution this cryptojs to install python module
@letcode
@letcode Жыл бұрын
Not sure, but I guess there should be a package, you can check in the pip
@smtabatabaie
@smtabatabaie 2 жыл бұрын
Is this possible to encrypt a data using another person's blockchain address (which is also their public key) in a way that they can only decrypt it using their own private key?
@letcode
@letcode 2 жыл бұрын
Not sure, but in general public and private key both are different, so it won't work.
@kriparao9696
@kriparao9696 10 ай бұрын
Is this possible in browser environment as well (for my frontend) or only in the nodejs environment?
@letcode
@letcode 10 ай бұрын
I guess it should be possible, but never tried in the browser.
@theillo4739
@theillo4739 2 жыл бұрын
You are the boss mate! :D Keep doing!
@letcode
@letcode 2 жыл бұрын
Hahah, ok boss
@maheshtekawade3952
@maheshtekawade3952 Жыл бұрын
Thanks for this Very useful ☺️
@letcode
@letcode Жыл бұрын
My pleasure 😊
@renitarenae1424
@renitarenae1424 2 жыл бұрын
Much needed video. But what can we do for Github actions? The run command on Github actions will carry the secret key know?
@letcode
@letcode 2 жыл бұрын
Yes it will work, I'll create a video.
@SamPrince
@SamPrince 2 жыл бұрын
Thanks for this. Another excellent and useful video - greatly appreciated. The encrypted strings have a lot of characters in common which would usually ring alarm bells for me about the (lack of) pseudorandomness. We've been using a text file sat outside of the project folder (in the user's profile/home directoryactually) to hold secrets, so they don't get shared around accidentally. That's fine when you all run locally on the same OS, but not as good if we did want to set up anything automated. One way or another the secrets need to be stored somewhere though e.g. an environment variable or shell script like you've shown here. Presumably with github actions there's a safe place to store them? It doesn't feel like environment variables were designed to be highly secure places, but perhaps they are safe.
@letcode
@letcode 2 жыл бұрын
Thanks. In GitHub actions, we can use the secret token. The Token will be passed to yml file, and using env we have to access it.
@ShashankPandey13
@ShashankPandey13 11 ай бұрын
It’s urgent bro 🔴
@letcode
@letcode 10 ай бұрын
What is that?
@ShashankPandey13
@ShashankPandey13 10 ай бұрын
@@letcode need your contact
@ShashankPandey13
@ShashankPandey13 10 ай бұрын
@@letcode need your contact
@orpheus.mn1
@orpheus.mn1 4 ай бұрын
This is just extra steps to giving away the information, not a valid solution
@letcode
@letcode 4 ай бұрын
What could be the ideal solution?
@Yasak-h6h
@Yasak-h6h 2 жыл бұрын
Oracle Pathi Video Podunga Bro
@letcode
@letcode 2 жыл бұрын
Java ah?
@Yasak-h6h
@Yasak-h6h 2 жыл бұрын
@@letcode Java Ila Bro Oracle
@letcode
@letcode 2 жыл бұрын
Ok bro
Reuse Playwright  Code across Files and Tests with Fixtures
5:54
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
7 Amazing Android Apps You Should Be Using! (2025 Update)
6:02
Brett In Tech
Рет қаралды 2,7 М.
Hashing Passwords in Node and Express using bcrypt
17:38
Sam Meech-Ward
Рет қаралды 34 М.
Learn Node.js in Under 50 Minutes: Complete Guide
50:35
LearnAIwithBibhu
Рет қаралды 424
How To Test Mobile & Desktop Browser? Playwright tutorial - Part 73
15:46
LetCode with Koushik
Рет қаралды 12 М.
Playwright Skip Login | Playwright Tutorial part - 31
11:06
LetCode with Koushik
Рет қаралды 23 М.
AES Explained (Advanced Encryption Standard) - Computerphile
14:14
Computerphile
Рет қаралды 1,3 МЛН
7 Cryptography Concepts EVERY Developer Should Know
11:55
Fireship
Рет қаралды 1,4 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН