github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/website/docs/language/functions/bcrypt.html.md (about) 1 --- 2 layout: "language" 3 page_title: "bcrypt - Functions - Configuration Language" 4 sidebar_current: "docs-funcs-crypto-bcrypt" 5 description: |- 6 The bcrypt function computes a hash of the given string using the Blowfish 7 cipher. 8 --- 9 10 # `bcrypt` Function 11 12 `bcrypt` computes a hash of the given string using the Blowfish cipher, 13 returning a string in 14 [the _Modular Crypt Format_](https://passlib.readthedocs.io/en/stable/modular_crypt_format.html) 15 usually expected in the shadow password file on many Unix systems. 16 17 ```hcl 18 bcrypt(string, cost) 19 ``` 20 21 The `cost` argument is optional and will default to 10 if unspecified. 22 23 Since a bcrypt hash value includes a randomly selected salt, each call to this 24 function will return a different value, even if the given string and cost are 25 the same. Using this function directly with resource arguments will therefore 26 cause spurious diffs. We recommend using this function only in `provisioner` 27 blocks, or in data resources whose results are only used in `provisioner` 28 blocks. 29 30 The version prefix on the generated string (e.g. `$2a$`) may change in future 31 versions of Terraform. 32 33 ## Examples 34 35 ``` 36 > bcrypt("hello world") 37 $2a$10$D5grTTzcsqyvAeIAnY/mYOIqliCoG7eAMX0/oFcuD.iErkksEbcAa 38 ```