# Rotating your Encryption Keys and Updating your Secrets with SOPS

DevFeed: [Rotating your Encryption Keys and Updating your Secrets with SOPS](<https://devfeed.tech/articles/rotating-your-encryption-keys-and-updating-your-secrets-with-sops-10659.md>)

Original publisher: [Read original article](<https://technotim.com/posts/rotate-sops-encryption-keys/>)

Author: Techno Tim

Published: 2023-03-05T15:00:00Z

Content type: tutorial

Language: en

Sources: [Techno Tim](<https://devfeed.tech/sources/techno-tim.md>)

Topics: [Encryption](<https://devfeed.tech/topics/encryption.md>), [GitOps](<https://devfeed.tech/topics/gitops.md>), [flux](<https://devfeed.tech/topics/flux.md>), [Kubernetes](<https://devfeed.tech/topics/kubernetes.md>), [Security](<https://devfeed.tech/topics/security.md>), [Script](<https://devfeed.tech/topics/script.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [flux](<https://devfeed.tech/tags/flux.md>), [git](<https://devfeed.tech/tags/git.md>), [gitops](<https://devfeed.tech/tags/gitops.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [script](<https://devfeed.tech/tags/script.md>), [secrets](<https://devfeed.tech/tags/secrets.md>), [security](<https://devfeed.tech/tags/security.md>), [utilities](<https://devfeed.tech/tags/utilities.md>)

## AI overview

A tutorial on rotating SOPS encryption keys and re-encrypting secret files. It describes generating a new key, using a script to decrypt files with the old key and encrypt them with the new key, testing decryption, and replacing the corresponding Kubernetes secret.

## Source excerpt

If you've been encrypting your secrets with SOPS and Age you know how useful it is to keep your secrets safe from prying eyes. If you're not familiar with encrypting your secrets with SOPS and Age, I highly recommend checking out a post I did a while back that shows you how easy it is to encrypt your secrets and even hide them in plain sight in a Git repo.I am happy (and relieved) that I starte...