$ openssl enc -base64 <<< 'And if the data is a bit longer, the base64 encoded data will span multiple lines.'QW5kIGlmIHRoZSBkYXRhIGlzIGEgYml0IGxvbmdlciwgdGhlIGJhc2U2NCBlbmNvZGVkIGRhdGEgd2lsbCBzcGFuIG11bHRpcGxlIGxpbmVzLgo=$ openssl enc -base64 -d << EOF> QW5kIGlmIHRoZSBkYXRhIGlzIGEgYml0IGxvbmdlciwgdGhlIGJhc2U2NCBlbmNv> ZGVkIGRhdGEgd2lsbCBzcGFuIG11bHRpcGxlIGxpbmVzLgo=> EOFAnd if the data is a bit longer, the base64 encoded data will span multiple lines.
openssl base64 -e <<< 'Welcome to openssl wiki' V2VsY29tZSB0byBvcGVuc3NsIHdpa2kKopenssl base64 -d <<< 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kK'Welcome to openssl wiki
警告 base64の行の長さは、opensslではデフォルトで64文字に制限されています :
openssl base64 -e <<< 'Welcome to openssl wiki with a very long line that splits...' V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRo YXQgc3BsaXRzLi4uCg==openssl base64 -d <<< 'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRoYXQgc3BsaXRzLi4uCg=='
openssl base64 -d -A <<<'V2VsY29tZSB0byBvcGVuc3NsIHdpa2kgd2l0aCBhIHZlcnkgbG9uZyBsaW5lIHRoYXQgc3BsaXRzLi4uCg=='Welcome to openssl wiki with a very long line that splits...