Open shari-sushi opened 11 months ago
https://github.com/sharin-sushi/0015docker/blob/issue/19-good_function/test0015Go/sample/ctypt.go
data= [99 0 95 88 192 95 153 201 44 94 6 77 245 77 149 100] block= &{{{[2591252068 655794047 1028899109 669566402 3217016259 2561235644 2784664473 2182241883 2259422361 503666213 3154103740 971871207 314464577 213585764 3074736856 2393461055 1739033240 1797031420 3696772900 1391531547 3366398927 2746986035 2145642775 756219660 914350841 2512669898 3928466909 3342162641 146371591 2642229453 2002427152 2960115649 1885264961 3978552460 2591652252 706133597 1018928116 3516432248 1273038564 1643624633 1783952302 3150744790 4029516338 2446996107] [1783952302 3150744790 4029516338 2446996107 4099971300 514796755 528794129 3231722715 3357677888 3939480631 19656386 3743739594 1971754663 586001783 3957611253 3725525000 976701973 1466645456 3372873602 904616701 3632084504 1834774981 2657274962 4242713983 64508248 3038857181 4080975255 1652580653 3763329219 3069777541 1176500810 2445204666 2518448460 1454820934 4041665743 3617662704 2187523090 3232413450 2790269577 659016255 2591252068 655794047 1028899109 669566402]}}} decrypted= [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] cbcDecrypter= &{0xc0003a85d0 16 [82 164 63 59 222 129 9 141 76 90 115 67 20 246 14 222] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]} cbcDecrypter= &{0xc0003a85d0 16 [99 0 95 88 192 95 153 201 44 94 6 77 245 77 149 100] [82 164 63 59 222 129 9 141 76 90 115 67 20 246 14 222]} ----Pkcs7Unpad---- data= [115 104 97 114 105 64 103 109 97 105 108 46 99 111 109 1] dataLength = 16 padLength = 1 data[:dataLength-padLength] =[115 104 97 114 105 64 103 109 97 105 108 46 99 111 109] Decrypted: shari@gmail.com ------------------------------- 以下自分用encryptedEmail = 9361c5df196aaef2fb621b66c18657b7 ----pkcs7Unpad---- data= [252 152 185 43 189 184 195 123 155 251 119 253 231 226 129 10 27 191 40 135 103 208 42 96 250 212 1 74 245 27 31 94] dataLength = 32 padLength = 94 panic: runtime error: slice bounds out of range [:-62] goroutine 1 [running]: github.com/sharin-sushi/0015docker/sample.pkcs7Unpad({0xc00051f100, 0x20, 0x20}) C:/Users/kawai tatuya/SESESE/0015Docker/test0015Go/sample/ctypt.go:87 +0x230 github.com/sharin-sushi/0015docker/sample.Decrypt({0xc00051f0c0?, 0xc000006018?}) C:/Users/kawai tatuya/SESESE/0015Docker/test0015Go/sample/ctypt.go:77 +0xef github.com/sharin-sushi/0015docker/sample.AlterMainCrypt() C:/Users/kawai tatuya/SESESE/0015Docker/test0015Go/sample/ctypt.go:37 +0x11f main.main() C:/Users/kawai tatuya/SESESE/0015Docker/test0015Go/cmd/main.go:22 +0x5c exit status 2
https://github.com/sharin-sushi/0015docker/blob/issue/19-good_function/test0015Go/sample/ctypt.go