Last active
May 15, 2023 18:27
-
-
Save ryzhovau/ce7eae2cad7f4e7b7704ecc272447ef1 to your computer and use it in GitHub Desktop.
Aegis → Bitwarden Migration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Converts Aegis data file to Bitwarden format | |
.DESCRIPTION | |
This is a way to import Aegis TOTP records to Bitwarden | |
.NOTES | |
* Export unencrypted *.JSON file from Aegis App | |
* Edit $AegisExportFile | |
* Run script | |
* Import *.JSON.Bitwarden.csv as Bitwarden CSV format | |
You'll find new TOTP accounts at "Aegis import YYYYMMDD" folder | |
Also, you have to add URLs to new accounts manually. | |
Tested on Aegis 2.1.3, Vaultwarden 2023.3.0, Linux Powershell 7.3.4 | |
.LINK | |
https://github.com/beemdevelopment/Aegis | |
https://github.com/dani-garcia/vaultwarden | |
#> | |
# Path to unencrypted Aegis backup file | |
$AegisExportFile = '~/Рабочий стол/aegis-export-plain-3390701544822992525.json' | |
# An import sanitizer | |
$ErrorActionPreference = 'Stop' | |
(Get-Content $AegisExportFile | ConvertFrom-Json).db.entries | | |
# Yandex, Steam and other non-standard algos ignored | |
Where-Object {$PSItem.info.algo -EQ 'SHA1'} | | |
ForEach-Object { | |
# CSV template from https://bitwarden.com/help/condition-bitwarden-import/ | |
[ordered]@{ | |
folder = 'Aegis import ' + (Get-Date -Format FileDate) | |
favorite = '' | |
type = 'login' | |
name = $PSItem.issuer | |
notes = '' | |
fields = '' | |
reprompt = 0 | |
login_uri = '' | |
login_username = $PSItem.name | |
login_password = '' | |
login_totp = $PSItem.info.secret | |
} | |
} | | |
Export-Csv -NoTypeInformation -QuoteFields $false -Encoding utf8 -Path ($AegisExportFile + '.Bitwarden.csv') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment