To protect passwords we can add salt while hashing. Different salt texts lead to different results for the very same password. But I noticed that I get the same result for different salt texts with bcrypt. See this example:
library("bcrypt")
my_password <- "password1"
my_salt_1 <- paste0("$2a$10$", paste0(letters[1:22], collapse= ""), collapse= "")
my_salt_2 <- paste0("$2a$10$", paste0(letters[c(1:21, 21)], collapse= ""), collapse= "")
hashpw(my_password, my_salt_1) == hashpw(my_password, my_salt_2)
TRUE
In fact it is easy to create more salts that result in the same hashing password. For example, we get the same hashing password using the salt paste0("$2a$10$", paste0(letters[c(1:21, 26)], collapse= ""), collapse= ""). Why is this happening? Is this only because the salts are qiute similiar or is here something else going on?