# Generating Google reCAPTCHA keys for site security

> Register your site with Google reCAPTCHA to get the site key and secret key you need to protect forms from spam.

Source: https://helpcenter.ruachost.com/ssl-security/website-security/generating-google-recaptcha-keys-for-site-security/

**Google reCAPTCHA** helps protect your website from spam and abuse by requiring users to complete a challenge or by scoring requests to detect bots. To integrate reCAPTCHA, you must generate **Site Key** and **Secret Key** values from Google.

## About Google reCAPTCHA

- Provides anti‑abuse security for websites and applications.
- Requires registering your domain with Google’s reCAPTCHA service.
- Two keys are issued:

  - **Site Key (public key)** → Used to render the reCAPTCHA widget on your site.
  - **Secret Key (private key)** → Used for server‑side validation of user responses.
- Keys are unique to each registered domain.

## Steps to Generate reCAPTCHA Keys

1. Sign in to your **Google account**.
2. Go to the Google reCAPTCHA site.
3. Click **Get Started**.
4. On the **Register a new site** page, provide:

   - **Label** → A name to identify the keys.
   - **reCAPTCHA type** → Choose between *challenge* (checkbox/image test) or *score* (v3 invisible).
   - **Domains** → Enter the domain(s) where the keys will be used (e.g., `example.com`).
5. Click **Submit**.
6. Google will generate your **Site Key** and **Secret Key**.

## Using the Keys

- **Site Key** → Add to your HTML page where you want the reCAPTCHA widget to appear.
- **Secret Key** → Store securely on your server; use it to validate user responses via Google’s API.

> **Note:**
- Keys must be generated separately for each domain.
- Do not share your **Secret Key** publicly.
- If you change your domain, you must generate new keys.
- reCAPTCHA improves site security but should be combined with other measures (SSL, firewalls, etc.).
