Advertisement
nicatronTg

Untitled

Apr 13th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.43 KB | None | 0 0
  1. olink [11:37 AM]
  2. what are you doing to the login code now
  3.  
  4. olink [11:37 AM]
  5. @nicatrontg:
  6.  
  7. nicatrontg [11:37 AM]
  8. moved the entire system to bcrypt
  9.  
  10. nicatrontg [11:38 AM]
  11. and added a migration system to move existing passwords to bcrypt
  12.  
  13. nicatrontg [11:38 AM]
  14. it works, but once someone logs in
  15.  
  16. nicatrontg [11:38 AM]
  17. it’s game over
  18.  
  19. nicatrontg [11:38 AM]
  20. their hash is a bcrypt hash now
  21.  
  22. nicatrontg [11:38 AM]
  23. and bcrypt hashes aren’t checked using just equivalence
  24.  
  25. olink [11:38 AM]
  26. how are you migrating salted passwords to something else?
  27.  
  28. nicatrontg [11:39 AM]
  29. we don’t salt passwords
  30.  
  31. nicatrontg [11:39 AM]
  32. :keepo:
  33.  
  34. nicatrontg [11:39 AM]
  35. at first login, we use the old code
  36.  
  37. olink [11:39 AM]
  38. we do something
  39.  
  40. olink [11:39 AM]
  41. Kappa
  42.  
  43. nicatrontg [11:39 AM]
  44. verify that your password matches
  45.  
  46. nicatrontg [11:39 AM]
  47. and then move it to bcrypt
  48.  
  49. olink [11:39 AM]
  50. so you added a field that checks if its been igrated
  51.  
  52. olink [11:39 AM]
  53. i reject
  54.  
  55. olink [11:39 AM]
  56. bad solution
  57.  
  58. nicatrontg [11:39 AM]
  59. no, didn't
  60.  
  61. olink [11:40 AM]
  62. so you check against a normal hash first, everytime?
  63.  
  64. nicatrontg [11:40 AM]
  65. bcrypt hashes are $2a$workfactor$salt.hashedpass
  66.  
  67. nicatrontg [11:40 AM]
  68. if it doesn’t start with $2a it isn’t a bcrypt hash
  69.  
  70. olink [11:40 AM]
  71. also uhmmm
  72.  
  73. olink [11:40 AM]
  74. theres a reason we added crypto in the config
  75.  
  76. olink [11:40 AM]
  77. so that its optional, no?
  78.  
  79. nicatrontg [11:41 AM]
  80. the only reason why it’s in the config is to support xp
  81.  
  82. olink [11:41 AM]
  83. not really
  84.  
  85. nicatrontg [11:41 AM]
  86. aka lower crypto versions than sha256
  87.  
  88. olink [11:41 AM]
  89. im pretty sure it supports md5
  90.  
  91. nicatrontg [11:41 AM]
  92. md5 is shit
  93.  
  94. olink [11:41 AM]
  95. yes, but we offer it as an option
  96.  
  97. olink [11:41 AM]
  98. i dont agree with forcing a new crypto on people
  99.  
  100. nicatrontg [11:41 AM]
  101. that was 2011
  102.  
  103. olink [11:41 AM]
  104. make it optional
  105.  
  106. nicatrontg [11:41 AM]
  107. no
  108.  
  109. olink [11:41 AM]
  110. then you have a :-1:
  111.  
  112. nicatrontg [11:41 AM]
  113. lol, I can prove you wrong scientifically
  114.  
  115. olink [11:42 AM]
  116. because you dont just go change someones database
  117.  
  118. olink [11:42 AM]
  119. if they dont want it
  120.  
  121. olink [11:42 AM]
  122. if people want bcrypt they will switch to it
  123.  
  124. olink [11:42 AM]
  125. if they dont care, which most dont, then its just a pita
  126.  
  127. nicatrontg [11:42 AM]
  128. no, it’s trivial and automatic
  129.  
  130. olink [11:42 AM]
  131. to you yse
  132.  
  133. olink [11:43 AM]
  134. but to someone running a server
  135.  
  136. olink [11:43 AM]
  137. they could care less
  138.  
  139. olink [11:43 AM]
  140. also good job breaking bamboo!
  141.  
  142. nicatrontg [11:43 AM]
  143. I broke bamboo?
  144.  
  145. olink [11:44 AM]
  146. if you change workfactor
  147.  
  148. olink [11:45 AM]
  149. wont it fail to find previous passwords
  150.  
  151. olink [11:45 AM]
  152. based on older work factors?
  153.  
  154. olink [11:45 AM]
  155. im not a bcrypt export
  156.  
  157. nicatrontg [11:45 AM]
  158. Nope, the work factor is stored in the password
  159.  
  160. olink [11:45 AM]
  161. expert even
  162.  
  163. nicatrontg [11:45 AM]
  164. If you run verify, it uses the stored work factor
  165.  
  166. nicatrontg [11:45 AM]
  167. which is why people call it future proof
  168.  
  169. nicatrontg [11:45 AM]
  170. you can upgrade the workfactor silently, and new users get more security for free
  171.  
  172. olink [11:45 AM]
  173. And the BCrypt lib doesnt support parsing a password
  174.  
  175. olink [11:45 AM]
  176. thats rich for future proof
  177.  
  178. olink [11:46 AM]
  179. >implement your own parsing of passwords
  180.  
  181. nicatrontg [11:46 AM]
  182. what does “parsing a password” mean?
  183.  
  184. olink [11:46 AM]
  185. :keepo:
  186.  
  187. olink [11:46 AM]
  188. https://github.com/NyxStudios/TShock/commit/08fae75c0ccab2fab1e1b3b47c421c5cd27dacfe
  189.  
  190. olink [11:46 AM]
  191. If someone is going to make a lib for doing bcrypto work, they should probably also provide the tools for working with an existing password
  192.  
  193. nicatrontg [11:46 AM]
  194. that’s just my check to get the work factor
  195.  
  196. olink [11:46 AM]
  197. yes the lib should do that
  198.  
  199. olink [11:46 AM]
  200. hence why I said what I said
  201.  
  202. olink [11:48 AM]
  203. did you verify that you didnt potentially break the login hooks?
  204.  
  205. olink [11:48 AM]
  206. one of which passes password
  207.  
  208. olink [11:51 AM]
  209. > This also changes User.Password to private set to prevent further accidents.
  210.  
  211. olink [11:51 AM]
  212. > public string Password { get; internal set; }
  213.  
  214. olink [11:51 AM]
  215. :keepo:
  216.  
  217. olink [11:53 AM]
  218. also any reason you didnt obsolete or outright remove the old hashing stuff?
  219.  
  220. nicatrontg [11:53 AM]
  221. please, wait for PR lol
  222.  
  223. nicatrontg [11:53 AM]
  224. I’m explaining it all
  225.  
  226. nicatrontg [11:53 AM]
  227. it’s a lot
  228.  
  229. nicatrontg [11:53 AM]
  230. well, ask here*
  231.  
  232. nicatrontg [11:53 AM]
  233. I’ll answer in PR
  234.  
  235. olink [11:53 AM]
  236. im trying to save you time by having you address the problems before you pr
  237.  
  238. nicatrontg [11:54 AM]
  239. the old hashing stuff is obsoleted, in Utils
  240.  
  241. nicatrontg [11:54 AM]
  242. unfortunately, we need to keep it around somewhere
  243.  
  244. nicatrontg [11:54 AM]
  245. so that we can still convert the old passwords
  246.  
  247. olink [11:54 AM]
  248. if its still being used dont obsolete it I guess
  249.  
  250. olink [11:54 AM]
  251. because this code will never be removable
  252.  
  253. nicatrontg [11:54 AM]
  254. well, again, I obsolete the public code
  255.  
  256. bccccc [11:54 AM]
  257. why would you want to parse a password?
  258.  
  259. nicatrontg [11:54 AM]
  260. the private internal code is not obsoleted
  261.  
  262. olink [11:55 AM]
  263. because apparently the password contains the information about the crypto algo
  264.  
  265. olink [11:55 AM]
  266. because "future proof"
  267.  
  268. bccccc [11:55 AM]
  269. suddenly we storing metadata in passwords
  270.  
  271. nicatrontg [11:55 AM]
  272. @bccccc: please, learn 2 bcrypt
  273.  
  274. olink [11:55 AM]
  275. bcrypt apparently does
  276.  
  277. olink [11:55 AM]
  278. also, as iw as saying
  279.  
  280. olink [11:55 AM]
  281. we cant remove that hashing code anyways
  282.  
  283. olink [11:55 AM]
  284. because there will be one user donw the road
  285.  
  286. olink [11:55 AM]
  287. in 2 years
  288.  
  289. olink [11:55 AM]
  290. who will log into an account
  291.  
  292. nicatrontg [11:55 AM]
  293. yes, exactly
  294.  
  295. olink [11:55 AM]
  296. and itll still be sha256
  297.  
  298. nicatrontg [11:56 AM]
  299. but the public code doesn’t need to exist
  300.  
  301. olink [11:56 AM]
  302. hence why i think its stupid to half switch them
  303.  
  304. nicatrontg [11:56 AM]
  305. (in Utils.cs, there is public code, that should be removed)
  306.  
  307. olink [11:57 AM]
  308. whelp theres one failure
  309.  
  310. olink [11:57 AM]
  311. should probably commit the dll
  312.  
  313. nicatrontg [11:57 AM]
  314. oops
  315.  
  316. nicatrontg [11:57 AM]
  317. bins are gitignored
  318.  
  319. nicatrontg [11:57 AM]
  320. let me just go add that
  321.  
  322. nicatrontg [11:57 AM]
  323. lol
  324.  
  325. olink [11:58 AM]
  326. while you are there
  327.  
  328. olink [11:58 AM]
  329. can you move all those folders into one References Folder, and move Newtonsoft up there as well
  330.  
  331. olink [11:58 AM]
  332. also
  333.  
  334. olink [11:58 AM]
  335. rip bamboo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement