From the course: Writing Secure Code for Android by Infosec
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Activity: Generating random values
From the course: Writing Secure Code for Android by Infosec
Activity: Generating random values
- [Instructor] Hashing. Activity. Generating Random Values. Open up a Kotlin Playground. And with this open, also go to wherever you have your Android Activities and browse down into Course Four, Generating Random Values, and find the text file Generating_random_values_snippet. We have two snippets in here that we're going to play with. One is, we're going to use Range. And Range has a random method that will, given whatever the range is, randomly pick a number. The other one is, we're going to use the Random function. So let's start with snippet one. Copy this. Go to the Playground and paste it in. In this first snippet, we're just going to use Range. Here's our range right here, from 10,000 to 20,000. Range has a random method. So let's pick a random number between these and we will assign rnds to whatever this result is. We're also going to convert it to a string, which is not something we really need right now, but we will need in another activity. After we create this random…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Android storage overview9m 25s
-
(Locked)
Protecting secrets13m 5s
-
(Locked)
Activity: Insecurely saving a username and password10m 5s
-
(Locked)
Encryption overview11m 48s
-
(Locked)
Understanding PKI10m 17s
-
(Locked)
Android encryption overview13m 55s
-
(Locked)
Activity: Encrypting data, part 113m 31s
-
(Locked)
Activity: Encrypting data, part 211m 21s
-
(Locked)
Activity: Encrypting data, part 312m 53s
-
(Locked)
Hashing8m 8s
-
(Locked)
Activity: Hashing a password9m 26s
-
(Locked)
Activity: Generating random values3m 52s
-
(Locked)
Activity: Salting a hashed password5m 51s
-
(Locked)
Android Keystore5m 46s
-
(Locked)
Activity: Securely storing secrets in Android Keystore12m 15s
-
(Locked)
-
-
-
-